Authentication Plugin 'Caching_Sha2_Password' Is Not Supported

Authentication plugin 'caching_sha2_password' is not supported

Per Caching SHA-2 Pluggable Authentication

In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password.

You're using mysql_native_password, which is no longer the default. Assuming you're using the correct connector for your version you need to specify the auth_plugin argument when instantiating your connection object

cnx = mysql.connector.connect(user='lcherukuri', password='password',
host='127.0.0.1', database='test',
auth_plugin='mysql_native_password')

From those same docs:

The connect() method supports an auth_plugin argument that can be used to force use of a particular plugin. For example, if the server is configured to use sha256_password by default and you want to connect to an account that authenticates using mysql_native_password, either connect using SSL or specify auth_plugin='mysql_native_password'.

Repeated NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported tried the previous solutions to no avail

Try

pip uninstall mysql-connector-python

and

pip install mysql-connector-python  

in windows command line window.

If it failed, try to

reconfigure MySql server

from MySql installer

then choose Use Legacy Authentication Method (Retain MySql 5x Compatibility)
in Authentication Method

Reconfiguring MySql server and reinstalling mysql connector python had removed my error

caching sha2 password is not supported mysql

I managed to fix this. In the end I was using a version of python in Anaconda which just wouldn't install version 8.0.11 of the python connector, I managed to get 8.0.11 installed on my vanilla python 3.6.5 using windows PowerShell (in admin privileges) and using pip install MySQL-connector-python (I think I also had to update pip from 9 to 10.

Authentication plugin 'caching_sha2_password' cannot be loaded

You can change the encryption of the user's password by altering the user with below Alter command :

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

OR

We can avoid this error by make it work with old password plugin:

First change the authentication plugin in my.cnf file for Linux / my.ini file in Windows:

[mysqld]

default_authentication_plugin=mysql_native_password

Restart the mysql server to take the changes in affect and try connecting via MySQL with any mysql client.

If still unable to connect and getting the below error:

Unable to load plugin 'caching_sha2_password'

It means your user needs the above plugin. So try creating new user with create user or grant command after changing default plugin. then new user need the native plugin and you will able to connect MySQL.

Thanks



Related Topics



Leave a reply



Submit