今天突然发现我的MYSQL无法建立innodb表了,显象是在Create Table 语句中指定了ENGINE=INNODB 但是表建完后发现有一个warning信息,使用show warnings /G查看发现,Mysql提示使用Myisam建立表。然后使用 Show Variables like '%innodb%' 查看发现have_innodb 的值为Disable这表明不能建立innodb表。后查看mysql的err日志发现有以下提示:
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/error-creating-innodb.html
根据上面的网页的提示,删除所有现有的ibdataN和ib_logfileN文件后,重启Mysql发现have_innodb的值恢复为Yes.