Sunday, May 27, 2018

Django attempting to connect to mysql without password even when password has been provided

This is the code in my settings.py :

import pymysql

pymysql.install_as_MySQLdb()

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'learn001',
'USER': 'test01',
'PASSWORD': 'test01', #Password is also test01


}
}

Yet , it is throwing the following error :

django.db.utils.OperationalError: (1045, "Access denied for user 'test01'@'localhost' (using password: NO)".

I don't understand why it is trying to connect without a password. 

It works properly if I create a user with no password and then provide it's username.




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bc025b3b-58b6-450a-8d37-3fca71568e72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment