[SQL]create table 'product_info' (
'product_id' varchar(32) not null,
'product_name' varchar(64) not null comment '商品名称',
'product_price' decimal(8,2) not null comment '单价',
'product_stock' int not null comment '库存',
'product_description' varchar(512) comment '描述',
'product_icon' varchar(512) comment '小图',
'category_type' int not null comment '类目编号',
'create_time' timestamp not null default current_timestamp comment '创建时间',
'update_time' timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
) comment '商品表';
[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 ''product_info' (
'product_id' varchar(32) not null,
'product' at line 1
请问这个哪里出问题了
create table product_info
(product_id
varchar(32) not null,product_name
varchar(64) not null comment '商品名称',product_price
decimal(8,2) not null comment '单价',product_stock
int not null comment '库存',product_description
varchar(512) comment '描述',product_icon
varchar(512) comment '小图',category_type
int not null comment '类目编号',create_time
timestamp not null default current_timestamp comment '创建时间',update_time
timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
PRIMARY KEY (product_id
)
) comment '商品表';
最后一行的表名备注,COMMENT='商品表'。没有加等于号
create table 'product_info' (
'product_id' varchar(32) not null,
'product_name' varchar(64) not null comment '商品名称',
'product_price' decimal(8,2) not null comment '单价',
'product_stock' int not null comment '库存',
'product_description' varchar(512) comment '描述',
'product_icon' varchar(512) comment '小图',
'category_type' int not null comment '类目编号',
'create_time' timestamp not null default current_timestamp comment '创建时间',
'update_time' timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
) comment ='商品表';
CREATE TABLE product_info
(product_id
varchar(32) NOT NULL,product_name
varchar(64) NOT NULL COMMENT '商品名称',product_price
decimal(8,2) NOT NULL COMMENT '单价',product_stock
int(11) NOT NULL COMMENT '库存',product_description
varchar(512) DEFAULT NULL COMMENT '描述',product_icon
varchar(512) DEFAULT NULL COMMENT '小图',category_type
int(11) NOT NULL COMMENT '类目编号',create_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',update_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (product_id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品表';
'update_time' timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
) comment '商品表'; 这一句后面修改时间后有一个小逗号,整个表达式就不完整了,去掉这个逗号或者加上PRIMARY KEY (product_id)都行