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 Answers 2

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
Sign up to request clarification or add additional context in comments.

Comments

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!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.