这段代码创建表死活通不过,说有语法错误,实在找不出来了,帮帮忙吧,急!CREATE TABLE USES(
id int(10) DEFAULT '0' NOT NULL,
username VARCHAR (200) DEFAULT '0' NOT NULL,
password VARCHAR (20) DEFAULT '0' NOT NULL,
PRIMARY KEY(id),
UNIQUE(id)
)ENGINE = MyISAM DEFAULT CHARSET=GBK ;
错误信息: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 '*/ CREATE TABLE USES( id int(10) DEFAULT '0' NOT NULL, username
id int(10) DEFAULT '0' NOT NULL,
username VARCHAR (200) DEFAULT '0' NOT NULL,
password VARCHAR (20) DEFAULT '0' NOT NULL,
PRIMARY KEY(id),
UNIQUE(id)
)ENGINE = MyISAM DEFAULT CHARSET=GBK ;
错误信息: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 '*/ CREATE TABLE USES( id int(10) DEFAULT '0' NOT NULL, username
Transfer Time : 00:00:01:125
Total Time : 00:00:01:719
---------------------------------------------------
-> id int(10) DEFAULT '0' NOT NULL
-> username VARCHAR (200) DEFAULT '
-> password VARCHAR (20) DEFAULT '0
-> PRIMARY KEY(id),
-> UNIQUE(id)
-> )ENGINE = MyISAM DEFAULT CHARSET
Query OK, 0 rows affected (0.06 sec)
id int(10) DEFAULT '0' NOT NULL,
username VARCHAR (200) DEFAULT '0' NOT NULL,
password VARCHAR (20) DEFAULT '0' NOT NULL,
PRIMARY KEY(id),
UNIQUE(id)
)ENGINE = MyISAM DEFAULT CHARSET=GBK ;
楼主的SQL中既然已定义ID为primary,为什么又定义UNIQUE(id),这样做有什么好处吗?
楼主的代码可以建立表啊!
CREATE TABLE USES(
id int(10) DEFAULT '0' NOT NULL,
username VARCHAR (200) DEFAULT '0' NOT NULL,
password VARCHAR (20) DEFAULT '0' NOT NULL,
PRIMARY KEY(id),
UNIQUE(id)
)ENGINE = MyISAM DEFAULT CHARSET=GBK ;
那个没什么好处,是失误,我已删除了UNIQUE(id)