Django MySQL error when creating tables

后端 未结 11 1564
感动是毒
感动是毒 2020-12-14 01:02

I am building a django app with a MySQL DB. When I run \'python manage.py migrate\' for the first time, some tables are created well then some errors appear. The error broug

11条回答
  •  别那么骄傲
    2020-12-14 01:32

    If the above does not work and you do not need Innodb, defaulting to MYISAM works as it does not have the same level of referential integrity:

    DATABASES = { 
      'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'name',                      
        'USER': 'user',     
        'PASSWORD': 'password',
        'OPTIONS': {
               "init_command": "SET storage_engine=MYISAM",
        }   
      }   
    }
    

提交回复
热议问题