whzeng
whzeng

Reputation: 41

MySQL 8.0.11 error connecting due to caching_sha2_password

When I try to connect to server on MySQL Workbench, I get the error saying

Your connection attempt failed to user 'root' from your host to server as localhost:3306:

Authentication plugin caching_sha2_password cannot be loaded:

The specified module could not be found.

It seems like I do not have the module for caching_sha2_password installed. How do I install this plugin?

I tried to follow steps provided here. But this is my first interaction with MySQL, so I did not understand the steps.

For example, under Using SHA-2 Pluggable Authentication, it says

"storing those values in the plugin and authentication_string columns of the > mysql.user system table."

But where is the mysql.user system table and how do I access it and store the values?

Any help would be greatly appreciated!

Upvotes: 3

Views: 5936

Answers (1)

Mike Lischke
Mike Lischke

Reputation: 53307

You are looking at the wrong places. The story is this:

MySQL 8 introduced a new authentication method: caching_sha2_password which improves performance (hence the caching) for a secure authentication (the sha2 hashing). This breaking change had been made the default for new accounts pretty late so that MySQL Workbench (and quite a number of other client tools) could not be made ready for it when MySQL 8.0.11 was released. Unprepared client applications/libraries will show the mentioned error.

Many of the socalled "solutions" simply recommend to switch the authentication method to the older, less secure one (MySQL native). This is rather a hack than a solution. And keep in mind this only applies to new accounts which by default use the new auth method. Existing accounts (e.g. when you upgrade an older server to 8.0) still work as before, unless you explicitly changed the user's auth method.

Meanwhile MySQL Workbench catched up here and there's a release candidate (MySQL Workbench 8.0.11 RC) available on the MySQL download page (see the "Development Releases" tab). Use that for your 8.x server. A GA version will follow soon.

Upvotes: 2

Related Questions