#1064 - 您的SQL语法有错误

0 mysql

我正在尝试根据我的软件中的说明设置表.这就是我输入的内容:

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;
Run Code Online (Sandbox Code Playgroud)

这是我回复的信息:

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 
Run Code Online (Sandbox Code Playgroud)

任何关于可能出错的建议都会非常感激.

Mah*_*ahn 13

这将帮助你指出你所使用的MySQL版本,但假设它为5.x,更换TYPE发动机(即ENGINE = MYISAM)应该做的伎俩.这是因为TYPE在较新版本的MySQL中已弃用,不再使用.