File "/usr/local/lib/python3.10/dist-packages/mysql/connector/authentication.py", line 190, in get_auth_plugin
raise errors.NotSupportedError(
mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported
报错分析
pip install mysql-connector后报错mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not suppot.
原因: 如果你的 MySQL 是 8.0 版本,密码插件验证方式发生了变化,早期版本为 mysql_native_password,8.0 版本为 caching_sha2_password
这个错误是因为你的MySQL服务器使用了 “caching_sha2_password” 认证插件,而你的Python MySQL驱动程序(mysql-connector)不支持该认证插件。
root@launch-advisor-20211123:/home# pip install --upgrade mysql-connector-python