I have a question:
My input:
JavaScript
x
10
10
1
import mysql.connector
2
import mysql.connector
3
4
mydb = mysql.connector.connect(
5
host = 'localhost',
6
user = 'root',
7
passwd = 'ananthjeahinowiamshowingmypasswordwitchisnotmypassword'
8
)
9
print(mydb)
10
And this is the output:
mysql.connector.errors.NotSupportedError: Authentication plugin
‘caching_sha2_password’ is not supported
Advertisement
Answer
Install the Python MySQL driver:
Similar Stack Overflow question
Just make sure to install the correct connector based on your operating system, MySQL version and the Python version you use:
JavaScript
1
2
1
pip install mysql-connector-python
2