MySQL在服务启动时崩溃。 打一个错误? 数据库损坏?

我有一个在这个时候离线的Web服务器,因为MySQL无法启动一个exception。 我找不到问题的根本原因,但是我害怕数据库损坏MySQL服务。

这里是/var/log/mysql/mysqld.err输出:

 ==> /var/log/mysql/mysqld.err <== 2015-02-11 23:45:11 25171 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem. 2015-02-11 23:45:11 25171 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-02-11 23:45:11 25171 [Note] InnoDB: The InnoDB memory heap is disabled 2015-02-11 23:45:11 25171 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2015-02-11 23:45:11 25171 [Note] InnoDB: Memory barrier is not used 2015-02-11 23:45:11 25171 [Note] InnoDB: Compressed tables use zlib 1.2.8 2015-02-11 23:45:11 25171 [Note] InnoDB: Using Linux native AIO 2015-02-11 23:45:11 25171 [Note] InnoDB: Using CPU crc32 instructions 2015-02-11 23:45:11 25171 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2015-02-11 23:45:11 25171 [Note] InnoDB: Completed initialization of buffer pool 2015-02-11 23:45:11 25171 [Note] InnoDB: Highest supported file format is Barracuda. 2015-02-11 23:45:11 25171 [Note] InnoDB: The log sequence numbers 43953950155 and 43953950155 in ibdata files do not match the log sequence number 43955508491 in the ib_logfiles! 2015-02-11 23:45:11 25171 [Note] InnoDB: Database was not shutdown normally! 2015-02-11 23:45:11 25171 [Note] InnoDB: Starting crash recovery. 2015-02-11 23:45:11 25171 [Note] InnoDB: Reading tablespace information from the .ibd files... 2015-02-11 23:45:11 25171 [Note] InnoDB: Restoring possible half-written data pages 2015-02-11 23:45:11 25171 [Note] InnoDB: from the doublewrite buffer... InnoDB: Last MySQL binlog file position 0 107020, file name ./mysqld-bin.000052 01:45:11 UTC - mysqld got signal 11 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=16777216 read_buffer_size=262144 max_used_connections=0 max_threads=151 thread_count=0 connection_count=0 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 134417 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0 thread_stack 0x40000 /usr/sbin/mysqld(my_print_stacktrace+0x3c)[0x7f122fe0d18c] /usr/sbin/mysqld(handle_fatal_signal+0x3c9)[0x7f122fc00c29] /lib64/libpthread.so.0(+0x102b0)[0x7f122e4ef2b0] /usr/sbin/mysqld(+0x792dd9)[0x7f122ff7bdd9] /usr/sbin/mysqld(+0x799787)[0x7f122ff82787] /usr/sbin/mysqld(+0x71a1bd)[0x7f122ff031bd] /usr/sbin/mysqld(+0x66f175)[0x7f122fe58175] /usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x41)[0x7f122fb65f41] /usr/sbin/mysqld(+0x487c32)[0x7f122fc70c32] /usr/sbin/mysqld(_Z11plugin_initPiPPci+0x5fc)[0x7f122fc7425c] /usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x7cb)[0x7f122fb5e7eb] /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f122db379f5] /usr/sbin/mysqld(+0x36c3d8)[0x7f122fb553d8] The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 

这个崩溃发生在mysql-5.6.22

有什么想法发生了什么?

你有一个(非常糟糕的)损坏的数据库,这是崩溃的MySQL。

作为一个旁注,这应该只发生在罕见的情况下,如内核冻结或断电,再加上强制innodb_flush_log_at_trx_commit为2或使用带有强制写入caching而没有备份电池的RAID控制器。

如果你要恢复数据,你可以尝试启动mysql,并将innodb_force_recovery设置为一个非零值 – 首先尝试将其设置为1,看看mysql是否启动,如果是的话,做一个mysqldump的数据库; 如果1的值没有帮助,请尝试2,依此类推。

更多细节在mysql文档中:

http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html