docker安装mysql后,本地navicat连接报错client does not support authentication

解决办法:
1. docker ps -a 查找到容器id
2. docker exec -it id /bin/bash 进入mysql容器 
3.mysql -u root -p root登陆mysql

4.alter user 'root'@'%' identified with mysql_native_password by '123456';

可能遇到问题:

Access denied for user 'root'@'localhost' (using password: YES)

解决办法:

update user set authentication_string = 'root' where user = 'root' and host = '%';
update user set authentication_string = 'root' where user = 'root' and host = 'localhost';

或者重新创建一个容器

posted on 2019-12-25 16:18  zhangmyname  阅读(4810)  评论(0编辑  收藏  举报