Django数据库连接

点击查看代码
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': "AaronCool",          # 你的数据库名称
        'USER': "root",          # 你的数据库用户名
        'PASSWORD': "Aaron2010", # 你的数据库密码
        'HOST': "localhost",          # 你的数据库主机,留空默认为localhost
        'PORT': "3306",         # 你的数据库端口
        'OPTIONS': {'init_command': 'SET default_storage_engine=INNODB;','charset':'utf8mb4'}
    }
}

posted @ 2024-01-03 16:39  Y沼泽Y  阅读(20)  评论(0)    收藏  举报