23
votes

I've tried to connect to the latest MySQL server 8.0.11 from MySQL workbench, but the error keeps popping up: Cannot connect to MySQL server, authentication plugin: caching_sha2_password: the specified module could not be found.

I tried looking at MySQL server installation videos online and replicated every step accurately, but the error persists.

Any help is greatly appreciated.

9

9 Answers

40
votes

I had the following solution: change my.ini in a [mysqld] section like this:

#default_authentication_plugin=caching_sha2_password  (comment line!)
default_authentication_plugin=mysql_native_password   (new line)

Connect to your MySQL under root in a command line client and execute:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxx';

Where xxx is your current password.

18
votes

Try to connect your MySQL use terminal, and use this.

mysql > ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
3
votes

See:

Changes in MySQL Workbench 8.0.11 (2018-04-19, Release Candidate)

...

  • MySQL Workbench now supports the caching_sha2_password authentication plugin introduced in MySQL 8.0 (see Caching SHA-2 Pluggable Authentication). A user account can be reset to use the other available authentication types for making a connection.

...

2
votes

After poking around I actually found a way to solve it:

During the configuration, when you reach the authentication method choose the Legacy Authentication Method.

It worked for me~!

2
votes

I was seeing this issue with HeidiSQL, and I found a workaround in the HeidiSQL Github repository:

https://github.com/HeidiSQL/HeidiSQL/issues/163

I fixed by copying libmysql.dll from my last MySql install to my HeidiSQL folder.

1
votes

If you have just installed mysql server. Run the installer again and it will allow you to reconfigure the options. On the third sceen it will say "Use legacy Authentication method" choose that option

1
votes

I know it is an old post. This is just to share my experience, hoping it will be useful for someone. I also faced similar issue. We can use the portable version of Heidisql. The portable version does not have this issue.

1
votes

using mysql_native_password is a workaround.

Your client software (MySQL Workbench) does not support the authentication plugin most probably because it is an older version.

https://tableplus.io/blog/2018/07/failed-to-load-caching-sha2-password-authentication-plugin-solved.html

follow the above link.

0
votes

The actual reason for "caching_sha2_password" is because while installing MySQL under Authentication Method, by default Use Strong Crypted Password radio button is chosen, instead we need to give User Legacy Authentication type password option for password

Run this in MySQL WorkBench:

ALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Then further edit the credential and schema to access under the below directory path:

ror_project_path/config/database.yml