我现在有一个离线的 Web 服务器,因为 MySQL 无法以异常启动。我找不到问题的根本原因,但我担心数据库损坏导致 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 或使用强制写入缓存但没有备用电池的 raid 控制器。
如果你必须恢复数据,你可以尝试将 innodb_force_recovery 设置为非零值来启动 mysql - 首先尝试将其设置为 1,查看 mysql 是否启动,如果是,则对数据库进行 mysqldump;如果值 1 没有帮助,请尝试使用 2,依此类推。
更多细节在 mysql 文档中:
http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html