1

When I am connecting db in Python I am getting error:

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

Code:

import mysql.connector
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="prakash17"
)
print(mydb)

2 Answers2

1

This has been answered here: Authentication plugin 'caching_sha2_password' is not supported

Solution would be to install mysql-connector-python instead of mysql-connector:

pip install mysql-connector-python
anonimac
  • 26
  • 2
0

I think the issue is you have misspelled password. Try this password = 'prakash17'

If that doesn't work then try password = ' '

Also make sure your Xampp is runny apache and mysql. Good luck!