2012-04-30 36 views
0

我想根据我的软件内的指令设置表格。这是我输入的内容:#1064 - 你的SQL语法有错误

CREATE TABLE `swd_account` (
`pk_account` int(11) NOT NULL auto_increment, 
`name` char(16) NOT NULL default '', 
`isact` tinyint(4) NOT NULL default '1', 
PRIMARY KEY (`pk_account`) 
) TYPE=MyISAM; 

CREATE TABLE `swd_user` (
`pk_user` int(11) NOT NULL auto_increment, 
`fk_account` int(11) NOT NULL default '0', 
`email` varchar(40) NOT NULL default '', 
`name` varchar(40) default NULL, 
`isact` tinyint(4) NOT NULL default '1', 
`datereg` date default NULL, 
`days` tinyint(4) default '0', 
`datelastsend` date default NULL, 
`messlastsend` int(11) default NULL, 
`countsend` int(11) NOT NULL default '0', 
`undelivered` tinyint(4) default NULL, 
PRIMARY KEY (`pk_user`), 
KEY `fk_account` (`fk_account`,`email`,`isact`), 
KEY `email` (`email`) 
) TYPE=MyISAM; 

这是我回来的消息:

Error 
SQL query: 

CREATE TABLE `swd_account` (

`pk_account` INT(11) NOT NULL AUTO_INCREMENT , 
`name` CHAR(16) NOT NULL DEFAULT '', 
`isact` TINYINT(4) NOT NULL DEFAULT '1', 
PRIMARY KEY ( `pk_account`) 
) TYPE = MYISAM ; 

MySQL said: 

#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 'TYPE=MyISAM' at line 6 

什么可能是错的任何建议,将不胜感激。

+3

不应该是'ENGINE = MyISAM'而不是'TYPE = MyISAM'? – David

回答

1

我敢打赌,他们的意思是ENGINE = MyISAM

13

如果你指出你所使用的MySQL版本,但假设它这将有助于为5.x,更换TYPEENGINE(即ENGINE = MYISAM)应该做的伎俩。这是因为TYPE在新版本的MySQL中被弃用,不再使用。