@[TOC]Mysql问题总结
docker创建mysql容器 远程连接mysql
1.1045 Access denied for user
我现在linux中可以登录 但连接mysql失败
网上说是密码错误(排除)
2.让执行以下代码
use mysql;
update user set Host='%' where User='root';
flush privileges;
报错 Duplicate entry %-root for key user.PRIMARY
直接放弃了 后来发现可能映射的端口号没改
2.1251- Client does not support authentication protocol requested by server;consider upgrading Mysql client
可能原因:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password
解决:执行
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
参考:link