Recently studied the django framework, the software used is:
Python 3.6;
Django2.1.3 ;
MySQL8.0
Driven MySQLclient;
Follow the steps on the website to configure django settings and access the local mysql. It will always report an error.
............
_mysql_exceptions.OperationalError: (2059, <NULL>);
Later, when I manually connected to MySQL, I found that the same error was reported, indicating that there was no connection. Later, I found that the related article found that MySQL8.0 password encryption uses the method of cache_sha2_password. It needs to be changed to mysql_native_password to be able to connect. .
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
So there is no problem.