MySQL8
之前的版本中加密规则是mysql_native_password
,而在MySQL8
之后,加密规则是caching_sha2_password
解决:
mysql -uroot -p
use mysql;
ALTER USER ‘root‘@‘%‘ IDENTIFIED BY ‘123456‘ PASSWORD EXPIRE NEVER; #更改加密方式
ALTER USER ‘root‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘123456‘; #更新用户密码
FLUSH PRIVILEGES; #刷新权限