Can't connect my code to my MySQL DB due to the authentication plugin
I'm trying to connect my code to a newly installed MySQL DB. I am aware that on MySQL 8.X and above, the authentication type is set to sha2 by default and I've read that I need to "force" a different authentication plug-in (auth_plugin='mysql_native_password').
well... I did it but I still get the same error message:
"Authentication plugin '{0}' is not supported".format(plugin_name)) mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported
What else should I do?
Thanks
import mysql.connector as Sql
myDB = Sql.connect(
host="localhost",
user="dbadmin",
password="myPassword",
auth_plugin="mysql_native_password"
)
print(myDB)