[Django]-Django Unknown system variable 'TRANSACTION' on syncdb

6👍

use

DATABASES = {

'default': {
    'NAME': 'test',
    'ENGINE': 'django.db.backends.mysql',
    'USER': 'redacted',
    'PASSWORD': 'redacted',
    'HOST': 'localhost'
    'OPTIONS': { "init_command": "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED"}   

},

}

ie without “storage_engine=INNODB,”. The latest versions of MySql engine by default INNODB.

👤Roman

0👍

  • Check your mysql version by running sudo mysqld --version
  • In mysql version 5.7.11, the storage engine system variable is: default-storege-engine therefore, your OPTIONS settings should be:

    {
    'OPTIONS': { "init_command": "SET default_storage_engine=INNODB"}
    }
  • To find the name of the storage engine variable on your system, run this command sudo mysqld --verbose --help | grep storage
👤Liyosi

Leave a comment