Authentication plugin #39;caching_sha2_password#39; cannot be loaded(无法加载身份验证插件“caching_sha2_password)
问题描述
我将 MySQL - 8.0 与 MySQL Workbench 连接,并收到以下错误:
I am connecting MySQL - 8.0 with MySQL Workbench and getting the below error:
无法加载身份验证插件caching_sha2_password":dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image未找到
Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found
我也尝试过其他客户端工具.
I have tried with other client tool as well.
有什么解决办法吗?
推荐答案
您可以通过以下 Alter 命令更改用户来更改用户密码的加密:
You can change the encryption of the user's password by altering the user with below Alter command :
ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY'密码';
ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';
或
我们可以通过使用旧密码插件来避免这个错误:
We can avoid this error by make it work with old password plugin:
首先更改Linux的my.cnf文件/Windows的my.ini文件中的认证插件:
First change the authentication plugin in my.cnf file for Linux / my.ini file in Windows:
[mysqld]
default_authentication_plugin=mysql_native_password
default_authentication_plugin=mysql_native_password
重新启动 mysql 服务器以使更改生效并尝试通过 MySQL 与任何 mysql 客户端连接.
Restart the mysql server to take the changes in affect and try connecting via MySQL with any mysql client.
如果仍然无法连接并出现以下错误:
If still unable to connect and getting the below error:
Unable to load plugin 'caching_sha2_password'
这意味着您的用户需要上述插件.因此,尝试在更改默认插件后使用 create user 或 grant 命令创建新用户.那么新用户需要本机插件才能连接MySQL.
It means your user needs the above plugin. So try creating new user with create user or grant command after changing default plugin. then new user need the native plugin and you will able to connect MySQL.
谢谢
这篇关于无法加载身份验证插件“caching_sha2_password"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法加载身份验证插件“caching_sha2_password"


基础教程推荐
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带更新的 sqlite CTE 2022-01-01