Navicat与mycat连接mysql问题1251 -Client does not support authentication protocol requested by server.....

51 篇文章 0 订阅
5 篇文章 0 订阅

Navicat 与 mycat 连接mysql问题 1251 -Client does not support authentication protocol requested by server consider upgrading MYSQL client
在这里插入图片描述
原因是mysql8.0新特性的问题,是由 caching_sha2_password 加密规则引起的,而mycat与老版本的navicat for mysql 的加密规则是 mysql_native_password

解决的办法:

  1. 使用新版的Navicat。
  2. 更改用户的加密规则为Navicat加密规则:

#首先连接mysql(123456 是你的密码)

[root@localhost ~]# mysql -uroot -p123456

#进入 mysql 库

mysql> use mysql;

#新建一个用户 ( starsky 是新用户名 123456 是密码 )

mysql> create user `starsky`@`%` identified by '123456';

#给予权限

mysql> grant all on *.* to `starsky`@`%` with grant option;

#修改加密规则

mysql> alter user 'starsky'@'%' identified with mysql_native_password by '123456';

#可能会出现报错,但是不用管
ERROR 1227 (42000): Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation

#查询一下内容
mysql> select user,host,plugin from mysql.user;
+------------------+-----------+-----------------------+
| user             | host      | plugin                |
+------------------+-----------+-----------------------+
| root             | %         | caching_sha2_password |
| starsky          | %         | mysql_native_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+

#看到用户 starsky 后面的plugin 为: mysql_native_password 即可。

然后即可解决报错 1251 的问题。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值