docker之MySQL8.0连接ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded

问题:

我在使用navicat 进行MySQL管理是出现了。2059 - authentication plugin 'caching_sha2_password' -navicat连接异常。这个错误。

这个错误的原因是由于MySQL8.0之后的加密规则为caching_sha2_password.而在此之前的加密规则为mysql_native_password。

可以将加密规则改成mysql_native_password来。

 

C:\mysqldata>mysql -h 127.0.0.1 -P 13306 -uroot -p
Enter password: ****
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: ÕÒ²»µ½Ö¸¶¨µÄÄ£¿é¡£

解决方案:

1.进入mysql容器

docker exec -it mysql2 /bin/bash

2.进入mysql

mysql -uroot -pmima

3.修改密码

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';

 

docker之MySQL8.0连接ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded