You need to have the database create permission as well. Otherwise django
can't recreate the database. What happens when you start the tests is that
the database is dropped and recreated each time.

Regards,

Andréas

2017-01-12 10:24 GMT+01:00 Shashank Yadav <shashank.yadav.14...@bml.edu.in>:

> Hello,
>
> I am working on tutorial 5 , i tried running a test:
>
> $ python manage.py test polls
> Creating test database for alias 'default'...
> Got an error creating the test database: (1044, "Access denied for user
> 'myprojectuser'@'localhost' to database 'test_myproject'")
> Type 'yes' if you would like to try deleting the test database
> 'test_myproject', or 'no' to cancel: yes
> Destroying old test database for alias 'default'...
> Got an error recreating the test database: (1044, "Access denied for user
> 'myprojectuser'@'localhost' to database 'test_myproject'")
>
>
> I have tried mentioning the test_name in settings.py
>
> DATABASES = {
>     'default': {
>         'ENGINE': 'django.db.backends.mysql',
>         'NAME': 'myproject',
>         'USER': 'myprojectuser',
>         'PASSWORD': 'password',
>         'HOST': 'localhost',
>         'PORT': '',
>         'TEST_NAME': 'test_database_myprojecttest',
>     }
> }
>
> I also ran ,"GRANT ALL PRIVILEGES ON test_myproject TO 
> 'myprojectuser'@'localhost';"
> , in mysql
>
>
> Still cannot run the test. What should i do ?
>
>
> --
> 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/482263d6-f640-46c0-928e-f532e0b6c838%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/482263d6-f640-46c0-928e-f532e0b6c838%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/CALXYUbn7fD4rqtaVNFTMUUcf4eDCpXBrswNEjzTrL_R99U9jfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to