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?
Solution 1:
you can change the encryption of the password like this.
ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';
Solution 2:
Note: For MAC OS
- Open MySQL from System Preferences > Initialize Database >
- Type your new password.
- Choose 'Use legacy password'
- Start the Server again.
- Now connect the MySQL Workbench
Solution 3:
For Windows 10:
Open the command prompt:
cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
C:\Program Files\MySQL\MySQL Server 8.0\bin> mysql -u root -p
Enter password: *********
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newrootpassword';
Query OK, 0 rows affected (0.10 sec)
mysql> exit
Alternatively, you can change the my.ini configuration as the following:
[mysqld]
default_authentication_plugin=mysql_native_password
Restart the MySQL Server and open the Workbench again.