本文翻译自:Authentication plugin 'caching_sha2_password' cannot be loaded
I am connecting MySQL - 8.0 with MySQL Workbench and getting the below error: 我正在将MySQL-8.0与MySQL Workbench连接起来并出现以下错误:
Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found 无法加载身份验证插件“ caching_sha2_password”:dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so,2):找不到映像
I have tried with other client tool as well. 我也尝试过使用其他客户端工具。
Any solution for this? 有什么解决办法吗?
参考:https://stackoom.com/question/3KPnD/无法加载身份验证插件-caching-sha-password
You can change the encryption of the user's password by altering the user with below Alter command : 您可以使用下面的Alter命令更改用户,从而更改用户密码的加密:
ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password'; ALTER USER'username'@'ip_address'用mysql_native_password标识'password';
OR 要么
We can avoid this error by make it work with old password plugin: 我们可以通过使用旧密码插件来避免此错误:
First change the authentication plugin in my.cnf file for Linux / my.ini file in Windows : 首先在Windows中的Linux / my.ini文件的my.cnf文件中更改身份验证插件:
[mysqld] [mysqld]
default_authentication_plugin=mysql_native_password default_authentication_plugin = mysql_native_password
Restart the mysql server to take the changes in affect and try connecting via MySQL with any mysql client. 重新启动mysql服务器以影响更改,并尝试通过MySQL与任何mysql客户端连接。
If still unable to connect and getting the below error: 如果仍然无法连接并出现以下错误:
Unable to load plugin 'caching_sha2_password'
It means your user needs the above plugin. 这意味着您的用户需要上述插件。 So try creating new user with create user or grant command after changing default plugin. 因此,尝试在更改默认插件后使用create user或grant命令创建新用户。 then new user need the native plugin and you will able to connect MySQL. 那么新用户需要本机插件,您就可以连接MySQL。
Thanks 谢谢
您可以像这样更改密码的加密。
ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';
like this? 像这样?
docker run -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql --default-authentication-plugin=mysql_native_password
mysql -uroot --protocol tcp
Try in PWD 尝试PWD
https://github.com/GitHub30/docs/blob/change-default_authentication_plugin/mysql/stack.yml https://github.com/GitHub30/docs/blob/change-default_authentication_plugin/mysql/stack.yml
or You shoud use MySQL Workbench 8.0.11. 或者您应该使用MySQL Workbench 8.0.11。
Note: For MAC OS 注意:对于MAC OS
Currently (on 2018/04/23), you need to download a development release . 当前(在2018/04/23上),您需要下载开发版本 。 The GA ones do not work. GA的无效。
I was not able to connect with the latest GA version (6.3.10). 我无法连接到最新的GA版本(6.3.10)。
It worked with mysql-workbench-community-8.0.11-rc-winx64.msi
(from https://dev.mysql.com/downloads/workbench/ , tab Development Releases ). 它与mysql-workbench-community-8.0.11-rc-winx64.msi
(来自https://dev.mysql.com/downloads/workbench/ , mysql-workbench-community-8.0.11-rc-winx64.msi
Development Releases中 )。