django 配置mysql資料庫

weixin_33924312發表於2019-01-25
DATABASE_ENGINE = 'django.db.backends.mysql'
DATABASES = {
    'default': {
        'ENGINE': DATABASE_ENGINE,  # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'learncelery',  # Or path to database file if using sqlite3.
        'USER': 'root',  # Not used with sqlite3.
        'PASSWORD': '',  # Not used with sqlite3.
        'HOST': '127.0.0.1',  # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '3306',  # Set to empty string for default. Not used with sqlite3.
#        'OPTIONS': {"init_command": "SET storage_engine=INNODB"}
    },
}

相關文章