Nikhil Bhardwaj
Nikhil Bhardwaj

Reputation: 582

Actually I connected my django database sqlite3 to Mysql database and whenever I migrate I get this error

System check identified some issues:

WARNINGS: ?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default' HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/2.1/ref/databases/#mysql-sql-mode Operations to perform:

Apply all migrations: admin, auth, blog, contenttypes, sessions Running migrations:

No migrations to apply.

Upvotes: 2

Views: 3528

Answers (1)

Reza Torkaman Ahmadi
Reza Torkaman Ahmadi

Reputation: 3048

add this option to your database config:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'OPTIONS': {
        'sql_mode': 'traditional',
    }
}
}

Note: Also it's not an error, it's a warning and will not stop your project from working.

Upvotes: 6

Related Questions