0

我正在尝试根据我的软件中的说明设置表格。这是我输入的:

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 

任何关于可能出错的建议将不胜感激。

4

2 回答 2

13

It would help if you pointed out which version of MySQL you are using, but assuming it is 5.x, replacing TYPE with ENGINE (ie ENGINE=MYISAM) should do the trick. This is because TYPE is deprecated in newer versions of MySQL and no longer used.

于 2012-04-30T20:07:57.217 回答
1

I bet they meant ENGINE = MyISAM.

于 2012-04-30T20:06:38.427 回答