[error] [mysql] 1251 - Client does not support authentication protocol requested by server
[error] [mysql] 1251 - Client does not support authentication protocol requested by server
客户端使用navicat for mysql。本地安装了mysql 8.0。但是在链接的时候提示:
1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
主要原因是mysql服务器要求的认证插件版本与客户端不一致造成的。
打开mysql命令行输入如下命令查看,系统用户对应的认证插件:
select user, plugin from mysql.user;
可以看到root用户使用的plugin是caching_sha2_password,mysql官方网站有如下说明:
Important
The caching_sha2_password authentication plugin on the server requires new versions of connectors and clients, which add support for the new MySQL 8.0 default authentication.
意思是说caching_sha2_password是8.0默认的认证插件,必须使用支持此插件的客户端版本。
plugin的作用之一就是处理后的密码格式和长度是不一样的,类似于使用MD5加密和使用base64加密一样对于同一个密码处理后的格式是不一样的。
解决方法:
我不希望更新本地的客户端版本,想直接使用原来的环境来链接。
解决方法是将root的plugin改成mysql_native_password。相当于降了一级。
mysql官方网站提供了从mysql_old_password升级到mysql_native_password,我们可以仿照这个。
alter user 'root'@'%' identified with mysql_native_password by "123456";
flush privileges;
这行代码有两层含义,第一:修改root的密码为’root’,摒弃原来的旧密码。第二:使用mysql_native_password对新密码进行编码。
修改完成后再用客户端登陆成功:
成功!
上一篇: mysql的jdbc驱动流式读取数据原理
下一篇: GO语言实现爬虫(实现文字和图片爬取)
推荐阅读
-
[error] [mysql] 1251 - Client does not support authentication protocol requested by server
-
mysql4.1以上版本连接时出现Client does not support authentication protocol问题解决办法
-
本地安装Mysql后,navicat链接异常:Clinet dose not support authentication protocol request by server ; consider upgrading MySQL client
-
mysql Client does not support authentication protocol requested by server; consider upgrading MySQL
-
解决Navicat连接MySQL时“Client does not support authentication protocol requested by server; consider upgrading MySQL client”的问题
-
mysql4.1以上版本连接时出现Client does not support authentication protocol问题解决办法_php技巧
-
连接8.0.15mysql 报错 client does not support authentication protocol requested by server ,consider upgra
-
nodejs连接mysql报错:Client does not support authentication protocol requested by server; consider upgrad
-
MySQL8.0报错Client does not support authentication protocol requested by server; consider upgrading My
-
MySql 链接报错“Client does not support authentication protocol requested by server; consider upgradin”