每Caching SHA-2 Pluggable Authentication
在MySQL 8.0中,
caching_sha2_password
是默认的身份验证插件,而不是mysql_native_password
.
您使用的是mysql_native_password
,这不再是默认值.假设您使用的是correct connector for your version,那么在实例化连接对象时需要指定the auth_plugin
argument
cnx = mysql.connector.connect(user='lcherukuri', password='password',
host='127.0.0.1', database='test',
auth_plugin='mysql_native_password')
同样的文件:
connect()
方法支持auth_plugin
参数,可用于强制使用特定插件.例如,如果服务器默认配置为使用sha256_password
,并且您希望连接到使用mysql_native_password
进行身份验证的帐户,请使用SSL连接或指定auth_plugin='mysql_native_password'
.