为什么这个表创建语句没有导致指定的类型?

时间:2011-07-05 01:06:57

标签: mysql

我在两个不同的主机上运行了以下内容:

CREATE TABLE IF NOT EXISTS `mydb`.`mytable` (
  `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `updated` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created` DATETIME,
  `deleted` TINYINT DEFAULT 0,
  `notes` TEXT DEFAULT '',
  `description` VARCHAR(100),
  INDEX `deleted` (`deleted`)
) TYPE=innodb;

在这两个地方都创建了一个表。然而,在其中一个表类型中,“MyISAM”而不是“InnoDB”。是什么给了什么?

编辑:啊哈! “SHOW ENGINES”显示InnoDB已禁用。如何启用它?

编辑:这是与问题服务器上的InnoDB相关的服务器变量:

innodb additional mem pool size 1,048,576
innodb autoextend increment 8
innodb buffer pool awe mem mb   0
innodb buffer pool size 8,388,608
innodb checksums    ON
innodb commit concurrency   0
innodb concurrency tickets  500
innodb data file path   
innodb data home dir    
innodb doublewrite  ON
innodb fast shutdown    1
innodb file io threads  4
innodb file per table   OFF
innodb flush log at trx commit  1
innodb flush method 
innodb force recovery   0
innodb lock wait timeout    50
innodb locks unsafe for binlog  OFF
innodb log arch dir 
innodb log archive  OFF
innodb log buffer size  1,048,576
innodb log file size    5,242,880
innodb log files in group   2
innodb log group home dir   
innodb max dirty pages pct  90
innodb max purge lag    0
innodb mirrored log groups  1
innodb open files   300
innodb rollback on timeout  OFF
innodb support xa   ON
innodb sync spin loops  20
innodb table locks  ON
innodb thread concurrency   8
innodb thread sleep delay   10,000

2 个答案:

答案 0 :(得分:2)

ENGINE=InnoDB,而不是 TYPE

答案 1 :(得分:0)

Duh,它出现在我的my.cnf文件中:

skip-innodb

那样,那里有我的my.cnf文件TWICE。所以我把它们评论出来了。瞧!现在可以创建InnoDB文件。