Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL changing authentication type from standard to caching_sha2_password

I've setup a new MySQL instance on a computer and every time I add a user it sets the Authentication Type to caching_sha2_password.

This happens even if I set the Authentication Type to "Standard", it then changes it when I save the user. I've also changed the default authentication plug in to "mysql_native_password", but it still keeps doing it.

With it using the caching_sha2_password I can't connect to the database from .net core as I get an error stating:

MySqlException: Authentication method 'caching_sha2_password' not supported by any of the available plugins

How do I get it to save users with the Standard authentication type?

like image 769
Matthew van Boheemen Avatar asked Apr 19 '18 23:04

Matthew van Boheemen


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.

How do I enable authentication in MySQL?

Tutorial MySQL - Configure the authentication via PasswordInstall the MySQL service. Access the MySQL command-line. On the authentication prompt, a password is not required. Verify the authentication plugin and the password configured to the ROOT user account.


2 Answers

I had the same problem today. The only way I found to fix it was:

  1. executing the install file
  2. select "Reconfigure" over the mysql server
  3. In Authentication Method tab, select "Use Legacy Authentication Method"

It should fix your problem.

like image 183
Meko Perez Estevez Avatar answered Sep 20 '22 13:09

Meko Perez Estevez


Run

mysql> CREATE USER ‘username’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’; 
like image 21
Elias Avatar answered Sep 19 '22 13:09

Elias