MySQL 连接错误: 'caching_sha2_password' 插件不支持的解决方案
该错误通常是因为 MySQL Connector/Python 驱动程序版本过低导致的。要解决此问题,请升级到 MySQL Connector/Python 8.0.11 或更高版本。
如果您已经使用了较新的版本,可以尝试将连接字符串中的 'auth_plugin' 参数设置为 'mysql_native_password'。例如:
cnx = mysql.connector.connect(user='username', password='password', host='localhost', database='database', auth_plugin='mysql_native_password')
如果仍然无法解决问题,可以尝试使用其他 MySQL 驱动程序,如 PyMySQL 或 mysql-connector-python-rf。
原文地址: https://www.cveoy.top/t/topic/ofTY 著作权归作者所有。请勿转载和采集!