[Solved] MYSQL Error: django.db.utils.OperationalError: (1045:Access denied for user ‘root’@’localhost’ (using password: NO)

Error Messages:
django.db.utils.OperationalError: (1045:Access denied for user ‘root’@’localhost’ (using password: NO)
Solution:
Run the following in mysql console, to change the password encryption method to the old version in Mysql(it is changed to use cha2 in Mysql 8.0)


mysql -u root -p
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';  
FLUSH PRIVILEGES;

Reference:

https://stackoverflow.com/questions/50652587/django-db-utils-operationalerror-1045access-denied-for-user-rootlocalhost

Similar Posts: