Home >Database >Mysql Tutorial >Why Does My Python MySQL Connection Fail with 'caching_sha2_password' Not Supported?
When attempting to connect to a MySQL server using the Python connector and creating a user with the mysql_native_password authentication plugin, an error message appears:
mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported
To resolve this issue, ensure that the correct Python package is installed. In the example code provided:
import mysql.connector cnx = mysql.connector.connect(user='lcherukuri', password='password', host='127.0.0.1', database='test') cnx.close()
Check that mysql-connector-python is installed instead of mysql-connector.
The above is the detailed content of Why Does My Python MySQL Connection Fail with 'caching_sha2_password' Not Supported?. For more information, please follow other related articles on the PHP Chinese website!