最近更换了服务器,从CentOS 5.8转到CentOS 6.4。 我在我的新服务器上安装了MySQL 5.1.69,并手动交换了/ var / lib / mysql。 我不确定我的旧服务器上有什么版本的MySQL,但预计它是一样的。
当我尝试查询一个表时,我得到以下内容:
ERROR 1286 (42000): Unknown table engine 'InnoDB'
不使用InnoDB的表工作正常。 看起来我没有加载InnoDB。 我使用yum install mysql mysql-server来yum install mysql mysql-server 。 为什么InnoDB没有加载,我应该如何加载?
编辑:
也许我应该手动更改ib_logfile0以使文件大小相同?
mysql> SHOW ENGINES; +------------+---------+-----------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +------------+---------+-----------------------------------------------------------+--------------+------+------------+ | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | +------------+---------+-----------------------------------------------------------+--------------+------+------------+ 4 rows in set (0.00 sec) mysql>
/var/log/mysqld.log:
130622 17:05:19 [Note] /usr/libexec/mysqld: Shutdown complete 130622 17:05:19 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 130622 17:06:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 130622 17:06:09 InnoDB: Initializing buffer pool, size = 8.0M 130622 17:06:09 InnoDB: Completed initialization of buffer pool InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes InnoDB: than specified in the .cnf file 0 5242880 bytes! 130622 17:06:09 [ERROR] Plugin 'InnoDB' init function returned error. 130622 17:06:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 130622 17:06:09 [Note] Event Scheduler: Loaded 0 events 130622 17:06:09 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.1.69' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
似乎这是一个很好的答案。 基本上说,你应该自己删除/重buildib_logfile0 。 只要将文件移到安全的地方,而不是在正在查找的MySQL目录中,然后重新启动服务器。
需要注意的是:你有没有需要InnoDB的数据库? 如果是这样,你可以手动执行每个数据库的mydump来获得备份,然后从MySQL数据库中删除数据库,closuresMySQL,移动/删除ib_logfile0 – 我也build议移动/删除ibdata1 & ib_logfile1只是重新启动MySQL。
然后检查你的日志,看看InnoDB是否已经启动。 我敢打赌会的。 在这一点上重新创build数据库,你摆脱和重新导入数据。 新的ibdata1 , ib_logfile0 & ib_logfile1文件将被创build,并且都应该是好的。
您是否从旧服务器复制了ib_logfile0文件? 如果是这样,请尝试将其移出该目录(或将其重命名)并重新启动mysqld。