[Answer]-[django+mysql]MySQLdb.connect works well, but cannot connect mysql via settings.py

1👍

The settings for the DB should be HOST and PORT, not DATABASE_HOST … so try this:

DATABASES = {
    'default':{
        'ENGINE' : 'django.db.backends.mysql',
        'NAME' : 'tasty',
        'USER' : 'root',
        'PASSWORD' : 'mycode',
        'HOST' : '127.0.0.1',
        'PORT' : '3306',
    },
}
👤Anzel

Leave a comment