wrong description
When using
Navicat Premium 12
to connect toMySQL
the database, an error is reported: Authentication plugin 'caching_sha2_password' cannot be loaded
wrong reason
The reason is that
mysql8
the encryption rules of previous versions aremysql_native_password
, butmysql8
the encryption rules of later versions arecaching_sha2_password
.
Solution
Revert
mysql
User Login Password Encryption Rules tomysql_native_password
step:
1. Windows + CMD
In 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:
reconnect successfully: