无法加载身份验证插件“ caching_sha2_password”

当尝试使用MySQL Workbench连接MySQL 8.0时,遇到'caching_sha2_password'插件加载失败的错误。解决方案包括:通过Alter命令更改用户认证方式为mysql_native_password,或者在my.cnf配置文件中设置默认认证插件为mysql_native_password,重启MySQL服务器。对于MAC OS用户,可以从系统偏好设置中初始化数据库并选择使用旧密码。另外,确保使用MySQL Workbench的正确版本,如开发版本。
摘要由CSDN通过智能技术生成

本文翻译自: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? 有什么解决办法吗?


#1楼

参考:https://stackoom.com/question/3KPnD/无法加载身份验证插件-caching-sha-password


#2楼

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 谢谢


#3楼

您可以像这样更改密码的加密。

ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';

#4楼

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。


#5楼

Note: For MAC OS 注意:对于MAC OS

  1. Open MySQL from System Preferences > Initialize Database > 从“系统偏好设置”>“初始化数据库”>“打开MySQL”
  2. Type your new password. 输入您的新密码。
  3. Choose 'Use legacy password' 选择“使用旧密码”
  4. Start the Server again. 再次启动服务器。
  5. Now connect the MySQL Workbench 现在连接MySQL Workbench

图片说明


#6楼

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中 )。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值