1.使用环境
windows10+python3.7+django2.1.5+mysql5.5
2 .报错
在运行 python manage.py migrate 这句命令时,报如下错误:
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”))
3.原因
查了资料后发现,django2.1不再支持mysql 5.5
4 解决方法
卸载mysql5.5,装mysql5.6 或者更高的版本,我装的是5.7版本,记得再卸载时要卸载得干净,不然可能安装不成功。
ps:mysql官网:https://dev.mysql.com/downloads/installer/