使用 Navicat 连接MySQL数据库时,出现这样的提示
2059 - Authentication plugin 'caching sha2 password' cannot be loaded: Ф*X00090ga
连接不上数据库
这句话的大概意思是:无法加载身份验证插件“缓存sha2密码”
查看MySQL官网参考文档
In MySQL 5.7, libmysqlclient uses as its default choice either mysql_native_password or the plugin specified through the MYSQL_DEFAULT_AUTH option for mysql_options().
When a 5.7 client tries to connect to an 8.0 server, the server specifies caching_sha2_password as its default authentication plugin, but the client still sends credential details per either mysql_native_password or whatever is specified through MYSQL_DEFAULT_AUTH.
- mysql8.0 以前的默认身份验证插件是
mysql_native_password
- mysql8.0 以后的默认身份验证插件是
caching_sha2_password
详情参考
解决
将MySQL8.0的身份认证插件改为mysql_native_password
- 打开命令提示符,打开mysql
mysql -u root -p
然后回车输入密码,进入mysql
- 输入
use mysql
回车
3. 修改身份认证插件,输入
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
后面同时将用户密码改为123456
- 刷新权限,输入
flush privileges;
修改成功!
最后重新打开Navicat 连接数据库。