0
Why python doesn't connect to mysql.connector
My OS is ubuntu 20.04 and to connect python to mysql I use this code : import mysql.connector cnx = mysql.connector.connect(user = 'root', password = 'My password', host = '127.0.0.1', database = 'mydb') cnx.close() But this error happens : Authentication plugin 'caching_sha2_password' is not supported Then I change my code to : import mysql.connector cnx = mysql.connector.connect(user = 'root', password = 'My password', host = '127.0.0.1', database = 'mydb', auth_plugin='mysql_native_password') cnx.close() and this error happens : Access denied for user 'root'@'localhost' Please tell me what should I do?
1 Respuesta