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

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';

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

@Kol_ya created new user using CREATE USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; where username = creation of new username and password = current password to login for root(username created with caching_sha2). This step allowed me to connect to MySql Server 8.0.13 without having caching_sha2 authentication error. Looked for solution several threads but this one helped just like that. Thanks @kol_ya

Suggestion to people who are having caching_sha2 issue. In server side make sure your user authentication type is standard not caching_sha2_password.

Omo-Nosa

This error is typically gotten when the DB user don't have all access to the database

Run this command:

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

*Make sure to have your MySQL server running.