Re: Access denied for MySQL user in Django

2017-10-09 Thread Ivan Gruer
Hi,
as far as i understood cdraccess  is a DB gust user, right?

If so, from your DB admin user, grant cdraccess to access MySQL environment 
table 'mysql.user' as follow:
 
GRANT SELECT ON `mysql`.`user` TO 'user_gui'@'%';

To me it worked,
Ivan

On Monday, January 25, 2016 at 7:52:33 PM UTC+1, James Schneider wrote:
>
>
>>> And I get the usual error message:
>>>
>>> (1045, u"Access denied for user 'cdraccess'@'77.95.177.35' (using password: 
>>> NO)")
>>>
>>>
>>> I have print statements and everything looks correct. It is printed as 
>>> it is in the settings.py file.
>>>
>>> One thing I noticed is that the IP 77.95.177.35 is my machine's IP, NOT 
>>> the host's IP. For some reason the host IP (as it is given in the 
>>> settings.py file) is replaced in this error message by my machine's IP. Is 
>>> that normal?
>>>
>>
>
> Another thought. Do you manage the server/MySQL instance? Have you looked 
> at the logs for MySQL to ensure that the password is the only issue? It's 
> possible you are getting access denied for a number of reasons, including 
> the database not existing when Django tries to access it.
>
> -James
>
>  
>

-- 
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/e44f3710-d693-4f37-8a03-9eff7aebd258%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access denied for MySQL user in Django

2017-10-09 Thread Ivan Gruer
Hi,
as far as i understood cdraccess  is a DB gust user, right?

If so, from your DB admin user, grant cdraccess to access MySQL environment 
table 'mysql.user' as follow:
 
GRANT SELECT ON `mysql`.`user` TO 'cdraccess'@'%';

To me it worked,
Ivan

On Thursday, January 14, 2016 at 2:27:27 PM UTC+1, 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.
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/71856d5f-d404-4637-8497-1203108d101a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.