目录

1.登录远程服务器上的mysql

2.运用mysql表

3.查找表的校验规则

4.查找user与host的对应关系

5.更改校验规则

6.验证校验规则是否更改成功


Navicat 12连接远程服务器的mysql8.0以上版本会报错

2059 - authentication plugin 'caching_sha2_password’

        这是因为mysql8.0以下版本用的是caching_sha_password校验规则,mysql8.0以上用的是caching_sha2_password校验规则。而Navicat 12 是遵循caching_sha_password校验规则。因此需要将远程服务器mysql8.0以上版本的caching_sha2_password改成caching_sha_password

1.登录远程服务器上的mysql

mysql -u root -p

2.运用mysql表

use mysql

3.查找表的校验规则

select user,plugin from user where user='root';

4.查找user与host的对应关系

 select user,host from user;

5.更改校验规则

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

 注:看你的root对应的是哪个host,如果对应的是%,就将localhost换成%

6.验证校验规则是否更改成功

select user,plugin from user where user='root';

更改成功可以通过Navcat 12 连接到远程服务器的mysql8.0以上版本了。 

更多推荐