authentication plugin caching

    xiaoxiao2024-12-01  58

    更新了一下mysql8.0,使用Navicat就连不上了,报错:

               Authentication plugin 'caching_sha2_password' cannot be loaded

    然后查了一下,发现解决方法了。

    解决方法:

       alter user 'root'@'localhost' identified by 'password' password expire never;   #修改加密规则 

       alter user 'root'@'localhost' identified with mysql_native_password by 'password';   #更新一下用户的密码 

       flush privilege;#刷新权限

       alter user ‘root’@‘localhost’ identified by ‘#新密码#’;#修改密码

    来自:https://blog.csdn.net/u011182575/article/details/80821418

     

    原理:

           mysql 8.0 默认使用 caching_sha2_password 身份验证机制 —— 从原来的 mysql_native_password 更改为caching_sha2_password。 从 5.7 升级 8.0 版本的不会改变现有用户的身份验证方法,但新用户会默认使用新的 caching_sha2_password 。

    来自:https://blog.csdn.net/u012613251/article/details/80346665

    最新回复(0)