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

前端 未结 5 1930
情深已故
情深已故 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条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 08:17

    Actually, there is no need to downgrade the MYSQL Server. Follow these two steps and it should work:

    Step 1: Change MYSQL configuration to use mysql_native_password. Edit one of ini files that mysqld is using. You can see which one my using the command

    mysqld --verbose --help 
    

    and make sure this line is added -

    default-authentication-plugin=mysql_native_password
    

    Step 2: Create an new or alter the existing user. To create a new with mysql_native_password password:

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

    and to alter user

    ALTER USER 'username'@'ip_address' IDENTIFIED WITH mysql_native_password BY 'password';
    

    By the way, this step is also pointed out by @Kol_ya

提交回复
热议问题