Error during Django “Running migrations”: django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query')

血红的双手。 提交于 2019-12-01 23:54:54

Please do this :
1- Install new fresh of mySQL server first.
2- Create new db
3- Config in django settings like this :

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'db_name',
    'USER': 'root',
    'PASSWORD': 'db_pass',
    'HOST': 'localhost',   # Or an IP Address that your DB is hosted on
    'PORT': '3306',
    'OPTIONS': {"init_command": "SET storage_engine=MyISAM"},
}

4- Re-run syncdb
5- Re-run migrate
I hope this work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!