「掘虫者说」Docker数据库ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be load

分析:

ERROR 2059 (HY000): Authentication plugin ‘caching_sha2_password’ cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

定位:

docker安装部署的mysql8.0数据库容器,与之前mysql5.7兼容性问题

解决:

进入容器,然后重新修改使用账号的密码执行命令,如下:
进入容器:

docker容器运行与退出
docker ps 
#下载centos镜像,运行一个名为mycentos的容器,并在容器里运行/bin/bash
# docker run -ti --name boss-mysql centos /bin/bash

#退出
exit

#关闭
docker stop pig-mysql

#重启
docker start pig-mysql

#重启后,在mycentos再打开/bin/bash
docker exec -ti pig-mysql /bin/bash

处理:

mysql -uroot -p

#ALTER USER 'root'@'xx.xx.xx.xx' IDENTIFIED WITH mysql_native_password BY 'xxx555';
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'xxx555';
Query OK, 0 rows affected (0.00 sec)

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

mysql> exit
Bye
root@4528f2f59840:/# exit
发布了83 篇原创文章 · 获赞 24 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/u010638673/article/details/104646978
今日推荐