1.问题
在 MySQL 8.0.27 中由 authentication_policy 来管理用户的身份认证:authentication_policy=caching_sha2_password,
2.解决方案
修改配置文件my.ini,将authentication_policy=caching_sha2_password, 改为:authentication_policy=*, 表示支持任意加密方式。修改完后,重启mysql服务。
SELECT user,authentication_string,plugin,host FROM mysql.user;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
ALTER USER '你自己的用户名就是上面查出来的user'@'你自己的host就是你上面查出来的host' IDENTIFIED WITH mysql_native_password BY 'root';