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
解决的办法:
- 使用新版的Navicat。
- 更改用户的加密规则为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 的问题。