Authentication plugin ‘caching_sha2_password’ cannot be loaded
解决方法:找到mysql下的MySQL 8.0 Command Line Client - Unicode,点击进入。
输入密码
查看身份验证类型
mysql> use mysql;
Database changed
mysql> SELECT Host, User, plugin from user;
+-----------+------------------+-----------------------+
| Host | User | plugin |
+-----------+------------------+-----------------------+
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | caching_sha2_password |
+-----------+------------------+-----------------------+
4 rows in set (0.00 sec)
root 用户的验证器插件为 caching_sha2_password
修改身份验证类型
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
生效身份验证类型
FLUSH PRIVILEGES;
问题成功解决!
验证一下
- 使用管理员身份运行命令提示符
- 输入
mysql -u root -p
- 输入密码,问题成功解决!