Navicat连接mysql8时,提示:Unable to load authentication plugin 'caching_sha2_password'.
原因:mysql 8.0 默认使用 caching_sha2_password 身份验证机制。
Mysql8之前用的是:mysql_native_password
解决方法:修改身份验证机制
1、登录MySQL
$mysql -u root -p 输入密码
2、查询用户
mysql> use mysql
mysql> select user,host,plugin,authentication_string from user;
3、修改身份验证机制
mysql> alter user 'root' @'%' identified with mysql_native_password by 'lianShi@!';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
4、再次查询,已是:mysql_native_password
5、navicat再次连接,连接成功。