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 是你的密碼)
[[email protected] ~]# 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 的問題。