1286 – 未知存储引擎“InnoDB”

我正在尝试使用roundcube,最近刚爆发。 我不知道这是否是由于最近发生的MySQL更新,但在phpMyAdmin中,如果我尝试查看表格,则会出现以下错误:

1286 - Unknown storage engine 'InnoDB' 

 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 | MyISAM storage engine | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ 8 rows in set (0.00 sec) 

 [mysqld] default-storage-engine=MyISAM local-infile=0 symbolic-links=0 skip-networking max_connections = 500 max_user_connections = 20 key_buffer = 512M myisam_sort_buffer_size = 64M join_buffer_size = 64M read_buffer_size = 12M sort_buffer_size = 12M read_rnd_buffer_size = 12M table_cache = 2048 thread_cache_size = 16K wait_timeout = 30 connect_timeout = 15 tmp_table_size = 64M max_heap_table_size = 64M max_allowed_packet = 64M max_connect_errors = 10 query_cache_limit = 1M query_cache_size = 64M query_cache_type = 1 low_priority_updates=1 concurrent_insert=ALWAYS log-error=/var/log/mysql/error.log tmpdir=/home/mysqltmp myisam_repair_threads=4 [mysqld_safe] open_files_limit = 8192 log-error=/var/log/mysql/error.log [mysqldump] quick max_allowed_packet = 512M [myisamchk] key_buffer = 64M sort_buffer = 64M read_buffer = 16M write_buffer = 16M 

想法如何解决? 它曾经工作得很好。

看起来像一个或多个InnoDB日志文件被损坏。

在这种情况下,即使没有在my.cnf文件中指定skip-innodb ,MySQL也不会加载引擎。

一个解决scheme是停止mysqld并删除这些日志文件要小心,因为你可以丢失你的数据

即使使用InnoDB,也可以删除ib_arch_log *文件。 InnoDB重做日志归档在MySQL 4.1中被禁用,我想。 InnoDB崩溃恢复需要ib_logfile *文件。 如果你closuresInnoDB干净,你可以删除它们,并在configuration文件中改变它们的大小。 当然,做这样的改变时你应该小心。 最好先备份。

所以程序应该是这样的:

 /etc/init.d/mysql stop mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak # these are your mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak # log files /etc/init.d/mysql start 

移动这些日志进行备份,不要删除它们;)

请在dba.stackexchange.com上查看一下这个答案,以获得一些有用的见解。

将这些行添加到my.cnf

默认存储引擎= innodb的
缺省表型= innodb的

然后重新启动MySQL:

服务mysql重启

当你禁用innodb时,不要忘记删除DBS中所有与innodb有关的表。 例如“mysql”数据库有5个:

 [email protected]$ mysql mysql -e 'show table status' | grep Unknown | awk '{print $1}' innodb_index_stats innodb_table_stats slave_master_info slave_relay_log_info slave_worker_info