问题描述:
docker成功启动mysql容器后使用navicat连接报1251 - Client does not support authentication protocol requested byserver;consider upgrading MySQL client
处理方法:
首先进入MySQL容器内
docker exec -it mysql bash
登录MySQL
mysql -u root -p 密码
查看用户信息
select host,user,plugin,authentication_string from mysql.user;
修改用户密码
-- 修改user为root,host为%的密码
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';
-- 修改user为root,host为localhost的密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';
再次连接测试,连接成功