Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication plugin 'caching_sha2_password' cannot be loaded

I am connecting MySQL - 8.0 with MySQL Workbench and getting the below error:

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.

Any solution for this?

like image 211
Aman Aggarwal Avatar asked Mar 09 '18 13:03

Aman Aggarwal


People also ask

What is caching_sha2_password MySQL?

In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password . For information about the implications of this change for server operation and compatibility of the server with clients and connectors, see caching_sha2_password as the Preferred Authentication Plugin.

Can't connect to MySQL the server requested authentication method unknown to the client?

If the authentication plugin type is not changed already it will throw an error message like “The server requested authentication method unknown to the client”. Solution : In order to fix this issue, you need to change the MySQL authentication plugin type. For this, you have to log in to the MySQL prompt first.

What is sha256 based password?

In the name sha256_password , “sha256” refers to the 256-bit digest length the plugin uses for encryption. In the name caching_sha2_password , “sha2” refers more generally to the SHA-2 class of encryption algorithms, of which 256-bit encryption is one instance.


2 Answers

you can change the encryption of the password like this.

ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword'; 
like image 87
twocold Avatar answered Sep 27 '22 21:09

twocold


Note: For MAC OS

  1. Open MySQL from System Preferences > Initialize Database >
  2. Type your new password.
  3. Choose 'Use legacy password'
  4. Start the Server again.
  5. Now connect the MySQL Workbench

Image description

like image 35
Santhosh Sivan Avatar answered Sep 27 '22 21:09

Santhosh Sivan