Galil,
I had a problem like this a couple years ago, and the solution
was to delete the anonymous MySQL guest user as:
mysql> use mysql;
mysql> delete from user where host='localhost' and 'user='';
mysql> flush privileges;
I'm not sure why Django 1.4 was trying to connect as the guest
user when it had a username and password that it was
supposed to be using, but for some reason it was. Deleting
the guest user from MySQL fixed it for me, and is a good idea
for security reasons anyhow.
--Fred
------------------------------------------------------------------------
Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
------------------------------------------------------------------------
On 1/14/16 7:11 AM, Galil wrote:
I have created a Django app and which uses MySQL. The settings.py file
in the database sections is:
|DATABASES
={'cdraccess':{'ENGINE':'django.db.backends.mysql','NAME':os.environ.get('CDR_DB_NAME','portal2'),'USER':os.environ.get('CDR_DB_USER','cdraccess'),'HOST':os.environ.get('CDR_DB_HOST','127.0.0.1'),'CONN_MAX_AGE':0,'PASSWORD':os.environ.get('CDR_DB_PASSWORD',''),},'default':{'ENGINE':'django.db.backends.sqlite3','NAME':'db.sqlite3',}}|
I run the app like:
|CDR_DB_PASSWORD='password'CDR_DB_HOST='host_name'./manage.py runserver|
but I get the following error:
Access denied for user 'cdraccess'@'host_ip_here' (using password:
NO)")
I tried to access the database from terminal, like:
|$ mysql --host=[host_name]--user=cdraccess -p portal2|
and worked fine.
What is going wrong in here? And what does this "(using password: NO)"
mean?
--
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+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto: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/e1c26a0d-a509-46eb-b496-f7f09161e606%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/e1c26a0d-a509-46eb-b496-f7f09161e606%40googlegroups.com?utm_medium=email&utm_source=footer>.
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+unsubscr...@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/5697DFA4.20300%40bristle.com.
For more options, visit https://groups.google.com/d/optout.