django migrate 报错(You have an error in your SQL syntax)
时光不写博客
2019-09-21
937浏览量
简介:
问题
django migrate 报错
在本地执行的时候发现没问题,到了服务器就不行了,报错
Operations to perform:
Apply all migrations: bank_detections
Running migrations:
Traceback (most r.
问题
django migrate 报错
-
在本地执行的时候发现没问题,到了服务器就不行了,报错
Operations to perform:
Apply all migrations: bank_detections
Running migrations:
Traceback (most recent call last):
File "/var/www/bank_detection/venv_bank/lib/python3.5/site-packages/django/db/backends/utils.py", line 82, in _execute
return self.cursor.execute(sql)
File "/var/www/bank_detection/venv_bank/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/var/www/bank_detection/venv_bank/lib/python3.5/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/var/www/bank_detection/venv_bank/lib/python3.5/site-packages/MySQLdb/cursors.py", line 312, in _query
db.query(q)
File "/var/www/bank_detection/venv_bank/lib/python3.5/site-packages/MySQLdb/connections.py", line 224, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.ProgrammingError: (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")
解决
更换Django的版本
本文链接:django migrate 报错
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。