How to disable caching_sha2_password in MySQL

In MySQL 8.0 caching_sha2_password is the default authentication plugin rather than mysql_native_password. This required many changes in the applications which trying to connect to database.

This article explains the steps to change back to the mysql_native_password plugin.

Step1: Open MySQL config.

#vi /etc/my.cnf

Step2: Update the following lines under "[mysqld]" and save.

default-authentication-plugin=mysql_native_password

Step3: Restart MySQL

#/etc/init.d/mysqld restart

If some users already created with caching_sha2_password, we can use the alter command to modify it.

ALTER USER 'username'@'host' IDENTIFIED WITH mysql_native_password BY 'password';

Here we need to replace the values of username, host and password with the corresponding data.

That's all…

Leave a Reply

Your email address will not be published. Required fields are marked *