docker安装mysql8.0连接问题,sqlyog报2058或者Navicat 1257
sqlyog连接mysql 8.0.21
, 8.0
, 8
, latest
版本报2058错误
尝试用Navicat Premium报了另一个错:1257
其实这两个错都是mysql8之后,加密规则改成caching_sha2_password而导致密码加密方式无发正常解析
问题解决
按照步骤
docker exec -it mysqlname bash 进入登录mysql
1.通过mysql -u root -p"123456" 进入mysql的命令行模式
2.修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;
查看修改结果:select user,host,plugin from user where user='root';
最后再次尝试用客户端连接