問題描述
我將 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"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!