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';
或者重新創建一個容器