很多用户在使用Navicat Premium 12连接MySQL数据库时会出现Authentication plugin 'caching_sha2_password' cannot be loaded的错误,解决方法如下
1. 管理员权限运行命令提示符,登陆MySQL
mysql -u root -p
password #登入mysql
2. 修改账户密码加密规则并更新用户密码
` ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则 `
` ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用户的密码 `
![image](https://upload-images.jianshu.io/upload_images/1996162-b1d31ea9a661f2e7?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3. 刷新权限并重置密码
` FLUSH PRIVILEGES; #刷新权限`
再重置下密码:
alter user 'root'@'localhost' identified by 'root';
现在再次打开Navicat Premium 12连接MySQL问题数据库就会发现可以连接成功了