How to change the authentication configuration of mysql connector to python?

I was trying to connect MySQL with python via the following code.

import mysql.connector
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  password="qwerty",
  auth_plugin="mysql_native_password"
)

print(mydb)

It gave me the following error:-

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

My connector version is:-

C:\Users\samar>pip install mysql-connector-python
Requirement already satisfied: mysql-connector-python in c:\users\samar\anaconda3\lib\site-packages (8.0.21)


Read more here: https://stackoverflow.com/questions/64952240/how-to-change-the-authentication-configuration-of-mysql-connector-to-python

Content Attribution

This content was originally published by Samar Pratap Singh at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: