当前位置: 代码迷 >> 综合 >> MySQL 8.0 Authentication plugin 'caching_sha2_password' cannot be loaded:找不到指定的模块
  详细解决方案

MySQL 8.0 Authentication plugin 'caching_sha2_password' cannot be loaded:找不到指定的模块

热度:104   发布时间:2023-10-09 07:03:48.0

服务器上新装的MySQL 8.0,使用图形化工具连接时提示

Authentication plugin 'caching_sha2_password' cannot be loaded:找不到指定的模块

这是由于加密方式导致的,执行命令

mysql> use mysql
Database changedmysql> select user,host,plugin from user;+------------------+-----------+-----------------------+
| user             | host      | plugin                |
+------------------+-----------+-----------------------+
| root             | %         | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
| root             | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+

解决方案:

//修改加密方式并指定密码
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '新密码';
Query OK, 0 rows affected (0.00 sec)//刷新权限
mysql> FLUSH PRIVILEGES;  
Query OK, 0 rows affected (0.00 sec)

命令执行完成后再次查看


mysql> select user,host,plugin from user;
+------------------+-----------+-----------------------+
| user             | host      | plugin                |
+------------------+-----------+-----------------------+
| root             | %         | mysql_native_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
| root             | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+

OK,这时候再使用新密码连接就成功了

  相关解决方案