Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 从SQLite转储创建表语法(1064)时出错_Mysql - Fatal编程技术网

Mysql 从SQLite转储创建表语法(1064)时出错

Mysql 从SQLite转储创建表语法(1064)时出错,mysql,Mysql,我在从SQLite3导入转储时遇到了问题,我通过脚本删除了大部分冲突,但仍有一些冲突 ERROR 1064 (42000) at line 558774: 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 'MONTH NOT NULL, grade INTEGER,

我在从SQLite3导入转储时遇到了问题,我通过脚本删除了大部分冲突,但仍有一些冲突

ERROR 1064 (42000) at line 558774: 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 'MONTH NOT NULL,
    grade INTEGER,
    school INTEGER REFERENCES school(id),
   ' at line 4
似乎不是,一些挂着的逗号,等等

第558774行是中的
月份
行:

...
INSERT INTO census_block VALUES(1234,-0.32,1.47,NULL,NULL);
INSERT INTO census_block VALUES(5678,-0.43,-0.24,NULL,NULL);
CREATE TABLE history(
    sid INTEGER NOT NULL REFERENCES student(sid),
    year YEAR NOT NULL,
    month MONTH NOT NULL,
    grade INTEGER,
    school INTEGER REFERENCES school(id),
    assigned_school INTEGER REFERENCES school(id),
    census_block INTEGER REFERENCES census_block(id)
);
INSERT INTO history VALUES(2319802,1991,9,9,1470,NULL,2468);
INSERT INTO history VALUES(2319802,1992,5,9,1470,NULL,3692);
...

MySQL中没有
Month
数据类型。相反,在
月份
列中使用
整数

CREATE TABLE history(
    sid INTEGER NOT NULL REFERENCES student(sid),
    year YEAR NOT NULL,
    month INTEGER NOT NULL,
    grade INTEGER,
    school INTEGER REFERENCES school(id),
    assigned_school INTEGER REFERENCES school(id),
    census_block INTEGER REFERENCES census_block(id)
);

Month不是合法的数据类型。将其更改为int或smallint,即月份int