这是8.0改了加密认证规则导致的。你可以去重新设置下密码
1.打开MySQL的命令行,输入数据库密码
2.修改加密规则:ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
3.更新用户密码:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
4.刷新权限: FLUSH PRIVILEGES;
5.重置密码:ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码'