0

I have a Django app on Heroku, I'm trying to connect that app to a Microsoft azure mySQL database. but the following error while in the Heroku BASH terminal when trying to create a superuser of migrating appears.

django.db.utils.OperationalError: (1044, "access denied for user 'azure username' to database 'azure db name'")

where azure username and azure db name are my personal corresponding database parameters that i've created through Microsoft's portal

my password is correct i've double checked it.

this is my production settings.py

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'azure db name',
    'USER': 'azure username',
    'PASSWORD': '',
    'HOST': 'eu-cdbr-azure-north-e.cloudapp.net',
    'PORT': '3306'
}

}

is there an extra parameter that i need to enter for validation? or an extra package that i need to install?

this is requirements.txt

appdirs==1.4.0
dj-database-url==0.4.2
Django==1.10.2
gunicorn==19.6.0
packaging==16.8
pyparsing==2.1.10
six==1.10.0
MySQL-python==1.2.5
mysqlclient==1.3.9

Thanks

Brian Formento
  • 731
  • 2
  • 9
  • 24
  • According to your configuration, it seems to be not any obvious missing or mistake. And there are some similar threads on StackExchange, such as http://dba.stackexchange.com/questions/95335/cleardb-granting-created-user-access, http://stackoverflow.com/questions/25446937/mysql-access-denied-for-user-to-database & http://stackoverflow.com/questions/10883668/access-denied-to-cleardb-database-using-python-django-on-heroku. I suggest that you can refer to these threads and post more information for helping analysis your issue. – Peter Pan Feb 07 '17 at 07:17
  • Meanwhile, it seems that you can connect your ClearDB on Azure, but got the error when doing some operation in Django, such as create a new database, please try to command `show grant` to check your permission. Any update, please feel free to let me know. – Peter Pan Feb 07 '17 at 07:21
  • So I realized that it dose connect to azure if I change the name parameter to the parameter given in the database parameter of the connection string! – Brian Formento Feb 07 '17 at 11:59

0 Answers0