用docker下载的镜像文件,然后启动镜像后,运行mysql实例正常,但是连接的时候报Client does not support authentication protocol requested by server; consider upgrading MySQL client,解决方法如下:
首先运行mysql容器:
//docker start 容器id
docker start 41dbc5ceca8b
切换到shell:
docker exec -it mysql01 bash
输入用户名和密码进入
root@41dbc5ceca8b:/# mysql -u root -p
Enter password:
修改mysql配置信息:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
SELECT plugin FROM mysql.user WHERE User = 'root';