解决问题有以下两种方式:
1.修改mysql密码加密规则;
2.修改配置文件;
修改配置文件方法如下:
default_authentication_plugin=caching_sha2_password 修改为:
default_authentication_plugin=mysql_native_password
使用MySQL命令进行更改加密规则
第一步:
alter USER ‘root’@‘localhost’ identified BY ‘password’ PASSWORD EXPIRE NEVER; #修改加密规则
第二步:
alter USER ‘root’@‘localhost’ identified WITH mysql_native_password BY ‘password’; #更新一下用户的密码
第三步:
alter user ‘root’@‘localhost’ identified by ‘你自己的密码’; #再重置下密码:
第四步:
flush privileges; #刷新权限