Navicat connects to MySQL 2059 error
Error code encountered while connecting MySQL in Navicat2059
, which means that the MySQL server does not accept encryption plugins provided by the Navicat client.
MySQL 8.0 and above use defaultcaching_sha2_password
Authentication plugins may lead to some clients.
Solution
Method 1
Change the authentication plugin for MySQL users tomysql_native_password
- 1. Log in to MySQL:
Open the command line or terminal and enter the following command to log in to MySQL using the root user:
mysql -u root -p
Enter the root password.
- 2. Modify the user authentication plug-in:
Run the following command to change the user's authentication plug-in tomysql_native_password
。
Assume your user isyour_user
, and the host islocalhost
:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'; FLUSH PRIVILEGES;
- 3. Exit MySQL:
EXIT;
- 4. Retry the connection:
Now, try reconnecting MySQL using Navicat.
Method 2: Upgrade Navicat
Make sure you are using the latest version of Navicat, as the new version of Navicat already supports MySQL 8.0 and its default onescaching_sha2_password
Certified plugin.
Detailed steps
- 1. Log in to MySQL
Open your command line or terminal and enter the following command:
mysql -u root -p
Enter the root user's password to log in to MySQL.
- 2. Modify the user's authentication plug-in
Assume your MySQL username isyour_user
, and you want to change the authentication plugin tomysql_native_password
:
ALTER USER 'your_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password'; FLUSH PRIVILEGES;
This will usersyour_user
The authentication plugin is modified tomysql_native_password
and set the password toyour_password
。
- 3. Confirm the changes
Use the following command to confirm that the user's authentication plug-in has been modified:
SELECT user, host, plugin FROM WHERE user = 'your_user';
confirmplugin
The value of the field ismysql_native_password
。
- 4. Retry the connection
Open Navicat and try to reconnect to MySQL using the modified user credentials.
Things to note
- There are risks in changing the authentication plugin: Changing the authentication plugin may affect other applications that use this user to connect, so be sure to know all related effects before making changes.
- Upgrade Navicat: Always use the latest version of Navicat for compatibility and security.
With these steps, it should be possible to resolve what is encountered when connecting MySQL in Navicat2059
mistake.
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.