老师好,新建表的时候migrate报错。

来源:4-4 新建项目

keep_study

2019-01-30

老师好,新建表的时候migrate报错。
可以帮我看看是什么原因吗?
raise MigrationSchemaMissing(“Unable to create the django_migrations table (%s)” % exc)
django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table ((1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘(6) NOT NULL)’ at line 1”))

写回答

1回答

Ethreal

2019-01-31

Django2.1不再支持MySQL5.5,必须5.6版本以上

解决办法:

二选一

(1)Django降级到2.0

pip install Django==2.0.0 -i https://pypi.douban.com/simple

(2)MySQL升级

建议降低django版本再次尝试

0
1
bobby
正解, mysql建议使用5.7版本
2019-02-01
共1条回复

Python3.6+django+xadmin,打造在线教育平台

【毕设】Python 2.7到3.6 完美适配,Django升级2.0

3677 学习 · 4041 问题

查看课程