我用mysql创建一张表,一直报错,一直找不出原因,请大神帮我看看,谢谢!
建表sql如下:CREATETABLEIFNOTEXISTSseckill('seckill_id'BIGINTNOTNULLAUTO_INCREMENTCOMMENT'...
建表sql如下:
CREATE TABLE IF NOT EXISTS seckill(
'seckill_id' BIGINT NOT NULL AUTO_INCREMENT COMMENT '商品库存ID',
'goodsname' VARCHAR(120) NOT NULL COMMENT '商品名称',
'goodsnumber' INT NOT NULL COMMENT '库存数量',
'start_time' TIMESTAMP NOT NULL COMMENT '秒杀开启时间',
'end_time' TIMESTAMP NOT NULL COMMENT '秒杀结束时间',
'create_time' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY(seckill_id),
KEY idx_start_time(start_time),
KEY idx_end_time(end_time),
KEY idx_create_time(create_time)
)ENGINE=INNODB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='秒杀库存表';
sql控制台所报的错误如下:
错误代码: 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 ''seckill_id' bigint NOT NULL AUTO_INCREMENT comment '商品库存ID',
'goodsname' at line 2 展开
CREATE TABLE IF NOT EXISTS seckill(
'seckill_id' BIGINT NOT NULL AUTO_INCREMENT COMMENT '商品库存ID',
'goodsname' VARCHAR(120) NOT NULL COMMENT '商品名称',
'goodsnumber' INT NOT NULL COMMENT '库存数量',
'start_time' TIMESTAMP NOT NULL COMMENT '秒杀开启时间',
'end_time' TIMESTAMP NOT NULL COMMENT '秒杀结束时间',
'create_time' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY(seckill_id),
KEY idx_start_time(start_time),
KEY idx_end_time(end_time),
KEY idx_create_time(create_time)
)ENGINE=INNODB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='秒杀库存表';
sql控制台所报的错误如下:
错误代码: 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 ''seckill_id' bigint NOT NULL AUTO_INCREMENT comment '商品库存ID',
'goodsname' at line 2 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |