navicat连接报错:Authentication plugin ‘caching_sha2_password‘ cannot be loaded的处理方法

navicat连接报错:Authentication plugin ‘caching_sha2_password‘ cannot be loaded的处理方法

今天使用Navicat12连接数据库,输入root密码后出现2059 - Authentication plugin ‘caching_sha2_password’ cannot be loaded报错,找了半天原因是MySQL8之前和之后的加密规则不同导致的,现在来处理这个问题。

1.打开MySQL的命令行,输入数据库密码

2.修改加密规则:ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER;

3.更新用户密码:ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;

navicat连接报错:Authentication plugin ‘caching_sha2_password‘ cannot be loaded的处理方法

4.刷新权限: FLUSH PRIVILEGES;

navicat连接报错:Authentication plugin ‘caching_sha2_password‘ cannot be loaded的处理方法

5.重置密码:ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘新密码’

navicat连接报错:Authentication plugin ‘caching_sha2_password‘ cannot be loaded的处理方法

这个时候就完成了修改,打开navicat连接数据库,输入新密码,就会显示连接成功
navicat连接报错:Authentication plugin ‘caching_sha2_password‘ cannot be loaded的处理方法