Navicat connects to MySQL and reports an error: Authentication plugin 'caching_sha2_password' cannot be loaded

wrong description

When using Navicat Premium 12to connect to MySQLthe database, an error is reported: Authentication plugin 'caching_sha2_password' cannot be loaded
insert image description here

wrong reason

The reason is that mysql8the encryption rules of previous versions are mysql_native_password, but mysql8the encryption rules of later versions are caching_sha2_password.

Solution

Revert mysqlUser Login Password Encryption Rules tomysql_native_password

step:

1. Windows + CMDIn the command window, enter the command to log in to MySQL

mysql -u root -p

Enter the correct password to log in.

2. Modify encryption rules

alter user 'root'@'localhost' identified by 'password' password expire never;

3. Update login password

alter user 'root'@'localhost' identified with mysql_native_password by 'password';

4. Refresh permissions

 FLUSH PRIVILEGES;

5. Reset password

alter user 'root'@'localhost' identified by '输入你要修改的登录密码';

Screenshot of operation:
insert image description here
reconnect successfully:
insert image description here

Guess you like

Origin blog.csdn.net/qq_40542534/article/details/117997127