使用MySQL,运行系统报错Authentication method 'caching_sha2_password' is not supported.

mysql 系统报错:{"state":"error","message":"Authentication method 'caching_sha2_password' }

原因:mysql版本身份验证引起的

解决方法:

1.查询mysql数据库中user表plugin列的值,是否如下

如果不同请如下操作:

       1.1:ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则 

        1.2:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用户的密码 

        1.3:FLUSH PRIVILEGES; #刷新权限 

        1.4:再重置下密码:alter user 'root'@'localhost' identified by '123456';

2.修改配置文件如下(my.ini文件):


default_authentication_plugin=mysql_native_password添加到配置中。

3.重启服务。

4.完成

posted @ 2020-09-04 17:47  HI_Hub_MI  阅读(2341)  评论(0)    收藏  举报