mysql.connector.errors.NotSupportedError: Authentication plugin ‘caching_sha2_password’ is not supported

A problem shows mysql.connector.errors.NotSupportedError: Authentication plugin ‘caching_sha2_password’ is not supported and interrupts us while running Java. This blog will see why it happens and how to solve it. Read it now!

How mysql.connector.errors.NotSupportedError: Authentication plugin ‘caching_sha2_password’ is not supported Occurs?

We attempted to link a MySQL database to a Python connector through the mysql connector, however, encountered the following issue.

mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported

What Solutions Can We Use To Fix It?

To fix it, run the pip uninstall mysql-connector to remove it and replace it with mysql-connector-python by using pip install mysql-connector-python. It should correct the error.

Solution 1

As instructed above, you should try to remove the mysql-connector using the pip uninstall mysql-connector command. After that, replace it with the python version by a simple pip install mysql-connector-python code, and it will solve your error.

Solution 2

Assuming you have the right connector, you must include the auth plugin option when creating your connection object.

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

The connect() function accepts an auth plugin parameter, which you may use to impose the usage of a certain plugin. For instance, if the site is set to use the default password, you may want to link it with a native password.

Conclusion

We hope you appreciated our blog post about mysql.connector.errors.NotSupportedError: Authentication plugin ‘caching_sha2_password’ is not supported. For questions or concerns about the content of this blog, please contact us at the discussion forum. 

Thank you for reading. We are always excited when one of our posts can provide useful information on this topic!

Scroll to Top