Django进行数据迁移时,报错:(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

在对应的应用里面的migrations文件夹中产生了一个0001_initial.py文件

 

第二步:执行sqlmigrate命令查看生成的文件本质

命令:python manage.py sqlmigrate 应用名 文件名前缀

例如:python manage.py sqlmigrate myblog 0001

 

第三步:执行migrate命令真正生成数据库表文件

命令:python manage.py migrate

 

 

 

现在出现一个问题:当执行第三步,同步数据库的时候,报错:

 

 经过网上搜索,原因是:

django2.1 版本不再支持mysql5.5

 

没办法,我的解决办法是:更换了Django版本号,或者mysql版本号。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 ERROR 1064 (42000): 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 Mysql语法错误之> 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' MySql 执行语句错误 Err] 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 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 '"id", mybatis批量更新update-设置多个字段值 报错 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 解决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 'order (order_name, customer) 插入数据库失败([Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version) check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY '123456' WITH GRANT OPTION' at line 1 mybatis的报错总结_____2Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ri Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your My
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM