[Answered ]-Django, MySQL, and Cloud9

1👍

Acording to the documentation you should connect to the database with following parameters:

Hostname  $IP       The same local IP as the application you run on Cloud9
Port      3306      The default MySQL port number
User      $C9_USER  Your Cloud9 user name

So try to add HOST/PORT values to the DATABASES setting:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'c9',
        'USER': 'my_username',
        'PASSWORD': '',
        'HOST': 'my_ip',
        'PORT': '3306',
    },
}

1👍

Try this 'HOST':'127.0.0.1'

   'default': {
        'ENGINE': 'django.db.backends.mysql',
        'HOST': '127.0.0.1',
        'USER': 'user_naeme',
        'NAME':'c9',
    }

0👍

i’m already have this problem and >> solved
you should add your Host name
e.g

'HOST': 'your_username.mysql.your_Host_name.com'

example my host is ‘pythonanywhere-services.com’
finally

DATABASES = {    'default': {
  'ENGINE': 'django.db.backends.mysql',
  'NAME': 'dataBaseName',
  'USER': 'urUser',
  'PASSWORD': 'urPass',
  'HOST': 'urUser.mysql.your_Host_name.com',    } }

Leave a comment