使用Python3.6 + Django2.1 + MySQL 5.5 在执行(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”))

万恶的兼容问题出现了。

之前在执行:python manage.py makemigrations 时一切正常。

可见问题是出在了MySQL上。于是乎,仔细的查看了Django的发行说明:

关于Django 2.1执行migrate报错:django.db.migrations.exceptions.MigrationSchemaMissing
关于Django 2.1执行migrate报错:django.db.migrations.exceptions.MigrationSchemaMissing
我最后的解决方式还是重装了mysql.

相关文章: