赶知识网

caching_sha2_password‘ cannot be loaded问题解决

2021-01-13 / 1711次点击 php/mysql/apache
在mac上安装 8.0.19版本的mysql后,使用navicat连接时,报caching_sha2_password' cannot be loaded的异常。


原因为:8.0.19版本的mysq用户密码加密方式为caching_sha2_password,navicat暂不支持,需要修改下mysql的加密方式。


解决过程:


1.登陆mysql


mysql -u root -p
2.查看当前加密方式


use mysql;
select user,plugin from user where user='root';
可以看到,root账号密码加密方式为caching_sha2_password。


3.修改加密方式


alter user 'root'@'localhost' identified with mysql_native_password by '你的密码';
4.刷新权限表,使设置生效


flush privileges;
有用 1 没用 0

Top10

沪ICP备09053415号 © 赶知识网