Sunday, May 27, 2018

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

I tried that. Still Doesn't work. I am using django 2.0. 
I found a stackoverflow thread which suggests that it might be a bug with pymysql along with mysql8.

It works properly when i create a user without password and provide it's credentials.

https://stackoverflow.com/questions/50336458/pymysql-access-denied-using-password-no-but-using-password


On Monday, May 28, 2018 at 12:33:11 AM UTC+5:30, Daniel Germano Travieso wrote:
Hello! What version of Django are you running?

You may need to provide extra info such as host and port

DATABASES = {      'default': {          'ENGINE': 'django.db.backends.mysql',          'NAME': 'mydatabase',          'USER': 'mydatabaseuser',          'PASSWORD': 'mypassword',          'HOST': '127.0.0.1',          'PORT': '5432',      }  }

Hope it helps


[]'s
Daniel Germano Travieso
Engenharia da Computação Turma: 013
Unicamp

On Sun, May 27, 2018 at 8:24 AM, Coder Dude <coderd...@gmail.com> wrote:
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...@googlegroups.com.
To post to this group, send email to django...@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.


On Monday, May 28, 2018 at 12:33:11 AM UTC+5:30, Daniel Germano Travieso wrote:
Hello! What version of Django are you running?

You may need to provide extra info such as host and port

DATABASES = {      'default': {          'ENGINE': 'django.db.backends.mysql',          'NAME': 'mydatabase',          'USER': 'mydatabaseuser',          'PASSWORD': 'mypassword',          'HOST': '127.0.0.1',          'PORT': '5432',      }  }

Hope it helps


[]'s
Daniel Germano Travieso
Engenharia da Computação Turma: 013
Unicamp

On Sun, May 27, 2018 at 8:24 AM, Coder Dude <coderd...@gmail.com> wrote:
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...@googlegroups.com.
To post to this group, send email to django...@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.


On Monday, May 28, 2018 at 12:33:11 AM UTC+5:30, Daniel Germano Travieso wrote:
Hello! What version of Django are you running?

You may need to provide extra info such as host and port

DATABASES = {      'default': {          'ENGINE': 'django.db.backends.mysql',          'NAME': 'mydatabase',          'USER': 'mydatabaseuser',          'PASSWORD': 'mypassword',          'HOST': '127.0.0.1',          'PORT': '5432',      }  }

Hope it helps


[]'s
Daniel Germano Travieso
Engenharia da Computação Turma: 013
Unicamp

On Sun, May 27, 2018 at 8:24 AM, Coder Dude <coderd...@gmail.com> wrote:
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...@googlegroups.com.
To post to this group, send email to django...@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.

--
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/9edd49c2-2d37-4828-bee8-9832a85d0a0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment