问题描述
我将 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"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!