ERROR 2059 (HY000)
ERROR 2059 (HY000)
SYMPTOMS
客户端远程连接数据库时出现验证错误
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: No such file or directory
CASE
该原因是 MySQL8 以后,加密规则是 caching_sha2_password,MySQL8 以前加密规则是 mysql_native_password
SOLUTION
-
修改
my.cnf文件,将加密规则改为mysql_native_password,重启服务sed -i '/\[mysqld\]/a default_authentication_plugin=mysql_native_password' my.cnf
-
重置密码,刷新权限
alter user 'root'@'%' identified by 'new_pass' password expire never;
alter user 'root'@'%' identified with mysql_native_password by 'new_pass';
flush privileges;
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.





