docker安装的mysql,连接mysql的时候报了如下错:
[root@localhost lib]# mysql -uroot -p -h 127.0.0.1
Enter password:
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
[root@localhost lib]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36d8ef44fe32 mysql "docker-entrypoint..." 5 minutes ago Up 5 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
解决办法:
1:进入mysql容器
[root@localhost lib]# docker exec -it mysql /bin/bash
进入mysql,修改下密码
root@36d8ef44fe32:/# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.16 MySQL Community Server - GPL
Cop