mysql - CREATE TABLE 中的 1064 错误 ... TYPE=MYISAM

标签 mysql syntax

这是我的错误(如果您需要更多信息,请询问)- 错误 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 older TYPE option was synonymous with ENGINE. 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 on TYPE to use ENGINE 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/

相关文章:

python - flask mysql 不为空

php - 使用 mysql_real_escape_string() 但允许带有撇号的名称

html - 音频播放器中的html/hta多个文件

php - 使用 PHP 将网页中的重音符号从 MySQL 转换为无重音符号

MySQL 将行转为动态数量的列

php - 服务器配置规划以运行 Laravel 应用程序

python - 这些 np.linalg.norm 方法有什么区别

c++ - 为什么 Qt 将 'PWD' 添加到未相对引用的库中?

javascript - 是否有通配符导出为的语法?

c - C 中的数组创建语法