问题
Unable to load authentication plugin 'caching_sha2_password
原因
这是 mysql 8.0+ 版本才出现的问题,原因是 mysql 8.0 默认使用 caching_sha2_password
身份验证机制,从原来的 mysql_native_password 更改为 caching_sha2_password
解决方法
1.修改数据库的配置(推荐)
2. 降低Mysql版本
解决步骤
1.左下角 cmd
2. mysql -uroot -p
3. root
(你数据库的密码)
select user,plugin from mysql.user;
这里需要将caching_sha2_password 修改为 mysql_native_password
5.ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'