我正在尝试使用 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
有什么办法可以修复吗?它以前工作得很好。
答案1
看起来一个或多个 InnoDB 日志文件已损坏。
skip-innodb
在这种情况下,即使你没有在配置文件中指定,MySQL 也不会加载引擎。我的cnf文件。
解决方案是停止mysqld
并删除这些日志文件但尽量小心丢失数据:
即使使用了 InnoDB,您也可以删除 ib_arch_log* 文件。我认为,在 MySQL 4.1 中,InnoDB 重做日志归档已禁用。ib_logfile* 文件是 InnoDB 崩溃恢复所必需的。如果您彻底关闭了 InnoDB,则可以删除它们并在配置文件中更改它们的大小。当然,进行此类更改时应小心谨慎。最好先进行备份。
因此该过程应该是这样的:
/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 上的这个答案获得一些有用的见解。
答案2
将这些行添加到我的cnf
默认存储引擎=innodb
默认表类型=innodb
然后重新启动MySQL:
服务 mysql 重启
答案3
当您禁用 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