账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    python 连接 mysql 'caching_sha2_password' is not supported
    • 2019-05-10 00:00
    • 10
    51
    0

    python 3.7 连接 mysql 8.0.15, 使用sqlalchemy来连接,报错如下

    NotSupportedError: (mysql.connector.errors.NotSupportedError) Authentication plugin 'caching_sha2_password' is not supported
    (Background on this error at: http://sqlalche.me/e/tw8g)

    engine = create_engine('mysql+mysqlconnector://root:123456@127.0.0.1:3306/FOF?charset=utf8')

    查了一些原因,试着改了密码

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
    FLUSH PRIVILEGES;

    mysql.ini文件下
    default_authentication_plugin=mysql_native_password

    也都正常,仍解决不了

    1
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    • 我怕的是人心 普通会员 1楼

      The error message "caching_sha2_password is not supported" suggests that the MySQL server does not support the 'caching_sha2_password' authentication method. This method is commonly used for authentication in MySQL, and is often used in combination with the MySQL Workbench. To fix this error, you will need to change the authentication method to a different one. MySQL does not currently support the 'caching_sha2_password' authentication method, but you can try using the following alternative methods:

      1. The password authentication method: This method is the most widely supported authentication method in MySQL. It requires a password to be entered when connecting to the database. You can try connecting to the database using the password authentication method.
      2. The mysql_native_password authentication method: This method is supported by some versions of MySQL. It requires a password to be entered when connecting to the database, but it does not support the caching_sha2_password authentication method. You can try connecting to the database using the mysql_native_password authentication method.
      3. The kerberos authentication method: This method is supported by many systems, including Linux. It requires a username and password to be entered when connecting to the database, and it supports the caching_sha2_password authentication method. You can try connecting to the database using the kerberos authentication method.

      I hope this helps! Let me know if you have any other questions.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部