mysql.connector.errors.NotSupportedError: Authentication plugin ‘caching_sha2_password‘ is not suppo


在这里插入图片描述

mysql机密规则引起的错误,解决方法二选一

  1. 修改mysql加密规则
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY'密码'

  2. python代码中添加auth_plugin='mysql_native_password'

mydb = mysql.connector.connect(
    host="*******",
    user="*******",
    password="*******",
    database="*******",
    auth_plugin='mysql_native_password'
)

猜你喜欢

转载自blog.csdn.net/m0_51777056/article/details/130342348