mysql_exceptions.OperationalError: (1045, “Access denied for user 'root'@'localhost' (using password: YES)”)

前端 未结 7 1699
长情又很酷
长情又很酷 2020-12-14 10:06

I\'ve started working with django, and here is the error on \'runserver\' after setting up \'DATABASES\' in settings.py

mysql_exceptions.OperationalError: (1         


        
7条回答
  •  伪装坚强ぢ
    2020-12-14 10:25

    The instruction said to add the username with the SQL statement as:

    GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON winestores.* TO username@127.0.0.1 IDENTIFIED by 'password';
    

    After doing this as root, I quit and tried to log back in with the new user. I got the ERROR 1045. I fixed it by logging back in as root and reissuing the SQL statement again except with username@localhost. It worked! I don't know why? Maybe it is the difference between IPs of '127.0.0.1' and 'localhost'???

    as read on dev.mysql.com.

提交回复
热议问题