django.db.utils.operationalError: (2059,“Authentication Plugin 'caching_sha2_password'”)

前端 未结 5 1931
情深已故
情深已故 2020-12-18 08:07

I am trying to connect my django project \'mysite\' to mysql. I made a user in mysql and granted it all privileges to access the project. These are the changes I made to set

5条回答
  •  旧时难觅i
    2020-12-18 08:27

    The issue is (probably) your (new) version of MySQL.

    Starting with version 8.04 MySQL uses caching_sha2_password as default authentication plugin where previously mysql_native_password has been used (which causes compatibility issues with older services that expect mysql_native_password authentication).

    Possible solutions:

    Downgrade the MySQL Server to a version below that change or change the authentication plugin (on a user basis)

    eg when creating the user:

    CREATE USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
    

提交回复
热议问题