Today when using Navicat to connect to mysql, a 2059 error was reported. In order to solve this seemingly easy problem, I also tried many methods. Here I will share my experience with you. experience of. (Recommended tutorial: navicat tutorial)
A 2059 error will occur when using navicat to connect to MySQL8. This is because the new version of MySQL uses the caching_sha2_password authentication method, but at this time Navicat does not yet support this verification method.
The solution is to change the verification method to the verification method mysql_native_password used in previous versions (5.7 and below).
For specific verification methods, you can view the user table plugin field in the default database 'mysql'.
No 2059 error will occur when logging in to the database from the command line. Log in to the database from the command line and execute the following command.
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
'root' can be changed to your own defined user name, 'localhost' refers to the IP open to the user, which can be 'localhost' (local access only, equivalent to 127.0.0.1), It can be specific '...' (a specific IP) or '%' (all IPs can be accessed). 'password' is the authentication password you want to use.
Friendly reminder: Be sure to remember the changed password, otherwise it will be very troublesome if you forget it.
##
The above is the detailed content of navicat reports 2059 error when connecting to MySQL. For more information, please follow other related articles on the PHP Chinese website!