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 thanmysql_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 anauth_plugin
argument that can be used to force use of a particular plugin. For example, if the server is configured to usesha256_password
by default and you want to connect to an account that authenticates usingmysql_native_password
, either connect using SSL or specifyauth_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.
Mysql database not connecting to python
It seems that your MySQL Server version is 8.x and in that case the default MySQL connector is caching_sha2_password
. In the other hand your error is maybe because your python client connector does not support this Authentication Plugin and you should explicitly change the Authentication Plugin to the old one (mysql_native_password
).
cnx = mysql.connector.connect(user='root', password='password',
host='127.0.0.1', database='db',
auth_plugin='mysql_native_password')
Related Topics
Python: Element Is Not Attached to the Page Document
Swapping Columns in a Numpy Array
Tkinter Ttk Treeview How to Set Fixed Width Why It Change With Number of Column
Suppress Stdout/Stderr Print from Python Functions
How to Get Local Issuer Certificate When Using Requests in Python
Import Error: Dll Load Failed in Jupyter Notebook But Working in .Py File
How to Check for an Exact Word in a String in Python
How to Remove Additional Commas in a List in Python
Swap First and Last Digits of a Number( Using Loops)
Pandas.Read_Excel Parameter "Sheet_Name" Not Working
Typeerror: Missing 1 Required Positional Argument: 'Self'
Converting Exponential to Float
How to Change the Foreground or Background Colour of a Tkinter Button on MAC Os X
Python: Printing Horizontally Rather Than Current Default Printing