在启用InnoDB引擎的同时启用 – 插件'InnoDB'初始化函数返回错误

在现在的生产服务器中,我们只用MyIsam表运行,因此我们使用skip-innodb选项禁用了innodb引擎。 但是现在我们需要启用innodb引擎以创buildless量innodb表。 所以我们在my.cnf中注释了[#skip-innodb]选项并重新启动。 请通过下面的案例,并要求提供任何解决scheme或提示相同?

情况1:使用skip-innodb选项禁用innodb,“mysql> show engines”如下所示。

mysql> show engines; +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | InnoDB | NO | Supports transactions, row-level locking, and foreign keys | NULL | NULL | NULL | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ 8 rows in set (0.01 sec) Engine | Support ... | InnoDB | NO ...... 

案例2:因为我想启用innodb,我命令#skip-innodb选项并重新启动。 但是现在显示引擎甚至没有在列表中显示InnoDB引擎。 ?

 mysql> show engines; +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | +------------+---------+----------------------------------------------------------------+--------------+------+------------+ 7 rows in set (0.00 sec) 

Mysql版本:5.1.57-community-log操作系统:CentOS版本5.7(最终版)

日志:

 120622 13:06:36 InnoDB: Initializing buffer pool, size = 8.0M 120622 13:06:36 InnoDB: Completed initialization of buffer pool 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.1/en/error-creating-innodb.html 120622 13:06:36 [ERROR] Plugin 'InnoDB' init function returned error. 120622 13:06:36 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 120622 13:06:36 [Note] Event Scheduler: Loaded 0 events 120622 13:06:36 [Note] /usr/sbin/mysqld: ready for connections. Version: '5.1.57-community-log' socket: '/data/mysqlsnd/mysql.sock1' port: 3307 MySQL Community Server (GPL) 

您的日志文件可能已损坏。试试这个:

  1. 停止mysql。
  2. 由于innodb表中没有以前的数据,因此删除(或移动到其他地方)日志文件时,应该在默认安装时将其命名为/var/lib/mysql/ib_logfile0/var/lib/mysql/ib_logfile1
  3. 再次启动mysql

为了显示mysql的innodb引擎状态,input这个

 mysql> show engine innodb status;