进行数据迁移时:

第一步:

命令: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版本号。

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")的更多相关文章

  1. 插入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

    插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...

  2. 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 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1

    mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...

  3. myBatis查询报错 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

    myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL se ...

  4. 解决ROR 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 'creat table study_record( id int(11) not null

    之前一直用的好好的,突然就出现了这个错误: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha ...

  5. 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

    mybatis批量更新update-设置多个字段值 2016年08月01日 12:49:26 姚一号 阅读数:29539 标签: mysql mybatis批量更新批量更新allowMultiQuer ...

  6. [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 ''<h1 style="text-align: center;">php

    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s ...

  7. ERROR: 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 'type=InnoDB' at line 7

    问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...

  8. 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

    关于用Power Designer 生成sql文件出现 错误  [Err] 1064 - You have an error in your SQL syntax; check the manual ...

  9. 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 'varchar(255), sort integer not null

    you have an error in your SQL syntax; check the manual that corresponds to your MySQL server version ...

  10. 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 'like '%逸%'' at line 1

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-/ ...

随机推荐

  1. PAT甲级——1011 World Cup Betting

    PATA1011 World Cup Betting With the 2010 FIFA World Cup running, football fans the world over were b ...

  2. winform显示word和ppt文档

    最近所做的项目中需要在Winform窗体中显示Office文档.刚开始就使用webBrowser控件实现的,但是后来发现这个控件在显示Office文档的时候有个限制:只支持Office2003之前的版 ...

  3. 关于VLC无法播放rtsp的问题分析

    我之前有一篇博客说,怎么通过vlc查日志,方法不知道是不是特别好,传送门:https://www.cnblogs.com/132818Creator/p/11136714.html 虽然在调试窗口上提 ...

  4. ioctl函数的使用之查看终端屏幕大小

    要想查看一个终端屏幕的大小,可以使用ioctl()函数,步骤如下. 1.首先找到对应终端的文件号,一般在   /dev/pts/....(0,1,2..).具体几号需要自己验证.如在pts目录下使用命 ...

  5. ddt-python测试数据驱动工具(转载)

    背景 python 的unittest 没有自带数据驱动功能. 所以如果使用unittest,同时又想使用数据驱动,那么就可以使用DDT来完成. DDT是 “Data-Driven Tests”的缩写 ...

  6. iOS UICollectionViewCell 的拖动

    1.长按cell的情况下实现拖动,所以理应想到用长按手势. 2.既然实现移动cell,就要看看UICollectionView 有没有方法或者协议可以移动的.通过查看UICollectionView的 ...

  7. EmguCV从位图(Bitmap)加载Image<Gray,byte>速度慢的问题

    先说背景.最近在用C#+EmguCV(其实就是用P/Invoke封闭了OpecCV,与OpenCVDotNet差不多) 做一个视频的东西.视频是由摄像头采集回来的1f/s,2048X1000大小,其实 ...

  8. Docker私有仓库管理

    docker load -i registry.tar.gz docker run -d -p 5000:5000 --restart=always --name registry -v /opt/m ...

  9. rancher1.6高可用集群搭建

    rancher高可用集群搭建 一.搭建环境 1.安装系统 下载centos最新版, http://mirrors.sohu.com/centos/7/isos/x86_64/CentOS-7-x86_ ...

  10. Tuning xgboost in R:Part 1

    第一次调整Boosting算法的参数可能是一个非常艰难的任务.有很多参数可供选择,调整不同的参数会有不同的结果产生.最好的调参可能是取决于数据.每当我得到一个新的数据集,我都会学到一些新的东西.对分类 ...