Skip to content

Instantly share code, notes, and snippets.

@tuchanemo
Created March 14, 2019 11:43
Show Gist options
  • Save tuchanemo/266ac478818973a4484141fdfcc24340 to your computer and use it in GitHub Desktop.
Save tuchanemo/266ac478818973a4484141fdfcc24340 to your computer and use it in GitHub Desktop.
mysql django setting
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'firstsql_db',
'USER': 'root',
'PASSWORD': '',
'HOST':'127.0.0.1',
'PORT':'3306',
'OPTIONS': {
'autocommit': True,
'init_command': "SET sql_mode='STRICT_TRANS_TABLES', innodb_strict_mode=1",
# Tell MySQLdb to connect with 'utf8mb4' character set
'charset': 'utf8mb4',
},
# Tell Django to build the test database with the 'utf8mb4' character set
'TEST': {
'CHARSET': 'utf8mb4',
'COLLATION': 'utf8mb4_unicode_ci',
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment