mysql连接工具连接Docker中的mysql报错:Client does not support authentication protocol requested by server;

1.进入mysql容器中

docker exec -it e4201834fce3(容器id) bash

2.进入mysql数据库

mysql -uroot -p

3.输入mysql密码

4.远程连接授权

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; 

mysql>FLUSH PRIVILEGES;

5.更改加密规则

mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

6.更新root用户密码

mysql>ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码'; 

7.刷新权限

mysql>FLUSH PRIVILEGES;

8.连接测试

你可能感兴趣的:(bug记录,mysql,docker,数据库)