1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli

当你用docker安装mysql的时候,是不是遇到了navicat测试不支持的问题:所以博主把自己的解决方法分享给大家,欢迎参考!

1251 Client does not support authentication protocol requested by server;consider upgrading MySQL client

如果对您有帮助 ,请多多支持.多少都是您的心意与支持,一分也是爱,再次感谢!!!

 支付宝赞赏:1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli记得点击下面的余额宝,红包可能要大些。注意:余额宝红包有效期三天(72小时) 在有效期内
余额宝红包使用完或过期才能有机会领取下个余额宝红包,感谢大家的支持!您的支持,我会继续分享更多的文章,欢迎关注!

当博主测试的时候也出现如下图所示:1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli

解决思路与办法:

1:查看所有容器:[[email protected] ~]# sudo docker ps -a     

1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli

2:查看已经启动的容器:

[[email protected] ~]# sudo docker ps -s

博主这里是有两个启动的容器

1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli

3:若mysql容器未启动,则通过以下命令启动:

sudo docker start mysql06

4:docker容器下命令行连接mysql数据库

  • 首先进入mysql容器的bash终端:
  • sudo docker exec -it mysql02 bash

5:连接mysql:mysql -u root -p

输入密码:123456登录进入

6:查看用户信息:

mysql> mysql> select host,user,plugin,authentication_string from mysql.user;

1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli

host为 % 表示不限制ip   localhost表示本机使用    plugin非mysql_native_password 则需要修改密码

所以这样还需要再重新设置修改密码:如下

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';

1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli

到此就解决了这个问题:

再次测试:

1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli

如果对您有帮助 ,请多多支持.多少都是您的心意与支持,一分也是爱,再次感谢!!!

 支付宝赞赏:1251 Client does not support authentication protocol requested by server;consider upgrading MySQLcli记得点击下面的余额宝,红包可能要大些。注意:余额宝红包有效期三天(72小时) 在有效期内
余额宝红包使用完或过期才能有机会领取下个余额宝红包,感谢大家的支持!您的支持,我会继续分享更多的文章,欢迎关注!