Docker Mysql 8.x Error 1251解决方案
从docker上拉mysql 8.x镜像无法远程访问。提示错误代码1251。
Client does not support authentication protocol requested by server; consider upgrading MySQL client
原因是mysql中默认加密方式从 mysql_native_password 改为 caching_sha2_password 的原因。
解决方式
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourRootPassword';
如果不行
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'YourRootPassword';
把加密方式改回以前的就可以远程连接了。
最后运行一下。
FLUSH PRIVILEGES;//更新权限

浙公网安备 33010602011771号