[Solved]-How can I specify multiple "init_command"s in Django's setup file

11👍

For me what worked was:

{ 'init_command': 'set storage_engine=InnoDB; \
                   set session transaction isolation level read committed'}

4👍

Not is:

 "init_command": 'set storage_engine=INNODB,    \
                  set transaction isolation level read committed;', }

It is:

 "init_command": 'set storage_engine=INNODB,    \
                  SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', }

0👍

@ChrisCurvey’s solution is OKay for me.

ENV: Python3.7.3 + Django2.2.1

'OPTIONS': {
    'init_command': 'SET default_storage_engine=INNODB, sql_mode="STRICT_TRANS_TABLES" ',
    'charset': 'utf8mb4',
},
👤xjzhou

Leave a comment