ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/local/mysql

docker   mysql8 的数据库服务器

(主要问题是运程连接时报错!)

在别一台主机上连接时产生下面问题:

[root@mysql data]# mysql -h192.168.0.210 -P3310 -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/local/mysql/lib/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
 

解决方案:

通过本地登陆到mysql里面设置

[root@bakserver ~]# mysql -h192.168.0.210 -P3310 -uroot -pJKYjky

..........

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
Query OK, 0 rows affected (0.14 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.08 sec)

设置完后再远程连接成功!

猜你喜欢

转载自blog.csdn.net/cbuy888/article/details/84893479