
MySQL建表错误???
建表语句如下:CreatetableUserInfo(idintprimarykeynotnullauto_increment,namevarchar(15)notnul...
建表语句如下:
Create table UserInfo(
id int primary key not null auto_increment,
name varchar(15) not null,
job tinyint not null,
level tinyint not null default 1,
cap tinyint not null,
cloth tinyint not null,
weapon_display tinyint not null,
weapon_2 tinyint,
weapon_3 tinyint,
weapon_near enum(0,1),
shoe tinyint not null,
money int not null,
passwordbag int not null,
team int not null,
company int,
hp int not null,
mp int not null,
exp int not null,
liliang int not null,
tizhi int not null,
minjie int not null,
wuxing int not null,
fuyuan int not null,
wugong int not null,
wufang int not null,
speed int not null,
canpluspoint tinyint not null,
qianneng int not null,
lastmap tinyint,
lastx int,
lasty int,
shifu int,
tudi_1 int,
tudi_2 int,
tudi_3 int,
tudi_4 int,
tudi_5 int,
islogin enum(0,1) not null,
lastlogintime datetime,
role enum(N,A),
hpshangxian int not null,
mpshangxian int not null,
expsuoxu int not null,
dollar int not null
);
ERROR 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 '0,1),
shoe tinyint not null,
money int not null,
passwordbag int not null,
team ' at line 11
究竟是怎么回事啊?我检查了好久都检查不出错误。。。。。。55555 展开
Create table UserInfo(
id int primary key not null auto_increment,
name varchar(15) not null,
job tinyint not null,
level tinyint not null default 1,
cap tinyint not null,
cloth tinyint not null,
weapon_display tinyint not null,
weapon_2 tinyint,
weapon_3 tinyint,
weapon_near enum(0,1),
shoe tinyint not null,
money int not null,
passwordbag int not null,
team int not null,
company int,
hp int not null,
mp int not null,
exp int not null,
liliang int not null,
tizhi int not null,
minjie int not null,
wuxing int not null,
fuyuan int not null,
wugong int not null,
wufang int not null,
speed int not null,
canpluspoint tinyint not null,
qianneng int not null,
lastmap tinyint,
lastx int,
lasty int,
shifu int,
tudi_1 int,
tudi_2 int,
tudi_3 int,
tudi_4 int,
tudi_5 int,
islogin enum(0,1) not null,
lastlogintime datetime,
role enum(N,A),
hpshangxian int not null,
mpshangxian int not null,
expsuoxu int not null,
dollar int not null
);
ERROR 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 '0,1),
shoe tinyint not null,
money int not null,
passwordbag int not null,
team ' at line 11
究竟是怎么回事啊?我检查了好久都检查不出错误。。。。。。55555 展开
1个回答
展开全部
enum括号里的内容,加上引号试试 enum('0','1') enum('N','A')
错误提示了有所说明了。“……near '0,1),……”,在 0,1)附近有错。
Create table UserInfo(
id int primary key not null auto_increment,
name varchar(15) not null,
job tinyint not null,
level tinyint not null default 1,
cap tinyint not null,
cloth tinyint not null,
weapon_display tinyint not null,
weapon_2 tinyint,
weapon_3 tinyint,
weapon_near enum('0','1'),
shoe tinyint not null,
money int not null,
passwordbag int not null,
team int not null,
company int,
hp int not null,
mp int not null,
exp int not null,
liliang int not null,
tizhi int not null,
minjie int not null,
wuxing int not null,
fuyuan int not null,
wugong int not null,
wufang int not null,
speed int not null,
canpluspoint tinyint not null,
qianneng int not null,
lastmap tinyint,
lastx int,
lasty int,
shifu int,
tudi_1 int,
tudi_2 int,
tudi_3 int,
tudi_4 int,
tudi_5 int,
islogin enum('0','1') not null,
lastlogintime datetime,
role enum('N','A'),
hpshangxian int not null,
mpshangxian int not null,
expsuoxu int not null,
dollar int not null
);
错误提示了有所说明了。“……near '0,1),……”,在 0,1)附近有错。
Create table UserInfo(
id int primary key not null auto_increment,
name varchar(15) not null,
job tinyint not null,
level tinyint not null default 1,
cap tinyint not null,
cloth tinyint not null,
weapon_display tinyint not null,
weapon_2 tinyint,
weapon_3 tinyint,
weapon_near enum('0','1'),
shoe tinyint not null,
money int not null,
passwordbag int not null,
team int not null,
company int,
hp int not null,
mp int not null,
exp int not null,
liliang int not null,
tizhi int not null,
minjie int not null,
wuxing int not null,
fuyuan int not null,
wugong int not null,
wufang int not null,
speed int not null,
canpluspoint tinyint not null,
qianneng int not null,
lastmap tinyint,
lastx int,
lasty int,
shifu int,
tudi_1 int,
tudi_2 int,
tudi_3 int,
tudi_4 int,
tudi_5 int,
islogin enum('0','1') not null,
lastlogintime datetime,
role enum('N','A'),
hpshangxian int not null,
mpshangxian int not null,
expsuoxu int not null,
dollar int not null
);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询