MySQL 错误 #1064

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5069848/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 18:51:23  来源:igfitidea点击:

MySQL Error #1064

sqlmysqlmysql-error-1064

提问by 0x60

Running this SWL query keeps returning:

运行此 SWL 查询不断返回:

#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 ')' at line 20

#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 ')' at line 20

CREATE TABLE users
(
    `a` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `b` VARCHAR(50) DEFAULT "USER",
    `c` INT(1) NOT NULL DEFAULT "0",
    `d` VARCHAR(30) NOT NULL,
    `e` VARCHAR(30) NOT NULL,
    `f` TEXT(30) NOT NULL,
    `g` TEXT(30) NOT NULL,
    `h` TEXT(30),
    `i` enum('i1','i2','i3') NOT NULL,
    `j` TEXT(60),
    `k` DATE NOT NULL,
    `l` VARCHAR(255) NOT NULL,
    `m` VARCHAR(255),
    `n` VARCHAR(255),
    `o` LONGTEXT NULL,
    `p` BLOB NULL,
    `q` VARCHAR(255) NOT NULL,
);

HELP!

帮助!

回答by Sarfraz

You should remove comma from the last entry:

您应该从最后一个条目中删除逗号:

CREATE TABLE users
(
    `a` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `b` VARCHAR(50) DEFAULT "USER",
    `c` INT(1) NOT NULL DEFAULT "0",
    `d` VARCHAR(30) NOT NULL,
    `e` VARCHAR(30) NOT NULL,
    `f` TEXT(30) NOT NULL,
    `g` TEXT(30) NOT NULL,
    `h` TEXT(30),
    `i` enum('i1','i2','i3') NOT NULL,
    `j` TEXT(60),
    `k` DATE NOT NULL,
    `l` VARCHAR(255) NOT NULL,
    `m` VARCHAR(255),
    `n` VARCHAR(255),
    `o` LONGTEXT NULL,
    `p` BLOB NULL,
    `q` VARCHAR(255) NOT NULL,  <--------------- this one
);