话不多说、先上图
原因:MySQL8 与 MySQL8之前版本的加密规则不一致
解决:将MySQL登录密码加密规则还原成mysql_native_password。
1.管理员运行命令提示符输入以下命令登入MySQL:
mysql -uroot -p
2.修改加密规则并修改密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'mysql' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysql';
3.刷新权限
FLUSH PRIVILEGES;
4.修改密码:
set password for 用户名@localhost = password(‘新密码’);
[参考文章](https://blog.csdn.net/u011182575/article/details/80821418)