这是我的错误(如果您需要更多信息,请询问)- 错误 SQL查询:
CREATE TABLE dave_bannedwords(
id INT( 11 ) NOT NULL AUTO_INCREMENT ,
word VARCHAR( 60 ) NOT NULL DEFAULT '',
PRIMARY KEY ( id ) ,
KEY id( id )
) TYPE = MYISAM ;
MySQL 说:
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
最佳答案
如 CREATE TABLE
Syntax 中所述:
Note
The olderTYPE
option was synonymous withENGINE
.TYPE
was deprecated in MySQL 4.0 and removed in MySQL 5.5. When upgrading to MySQL 5.5 or later, you must convert existing applications that rely onTYPE
to useENGINE
instead.
因此,你想要:
CREATE TABLE dave_bannedwords(
id INT(11) NOT NULL AUTO_INCREMENT,
word VARCHAR(60) NOT NULL DEFAULT '',
PRIMARY KEY (id),
KEY id(id) -- this is superfluous in the presence of your PK, ergo unnecessary
) ENGINE = MyISAM ;
关于mysql - CREATE TABLE 中的 1064 错误 ... TYPE=MYISAM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12428755/