Docker 部署完mysql8 ,客户端连接时报MySQL 8.0 Public Key Retrieval is not allowed
解决方法:
1.docker ps查看运行的mysql容器名称
2.docker exec -it mysql_test /bin/bash 进入容器内部,mysql8031为容器名称
- mysql -u root -p 进行连接,输入密码连接成功
4.修改连接认证方式
ALTER USER root@‘%’ IDENTIFIED WITH mysql_native_password BY ‘123456’;
– 刷新权限
FLUSH PRIVILEGES;
5.查看是否修改成功
select host, user, plugin, authentication_string, password_expired from user;
6.远程连接测试,成功