MySQL无法启动且error.log持续写入的故障排查求助
MySQL无法启动且error.log持续写入的故障排查求助
最近我在Ubuntu服务器上托管的网站开始显示 "Error establishing a database connection"。
连接到服务器后,我发现MySQL一直在频繁重启——每次执行sudo systemctl status mysql.service命令,结果里的启动时间都是几秒或几十秒前:
mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: activating (start) since Fri 2023-09-15 14:31:16 UTC; 3s ago Process: 8351 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 8362 (mysqld) Status: "Server startup in progress" Tasks: 12 (limit: 4541) Memory: 318.8M CGroup: /system.slice/mysql.service └─8362 /usr/sbin/mysqld
我的/var/log/mysql/error.log文件增长得很快,里面有大量乱码,之后跟着如下错误文本:
InnoDB: End of page dump InnoDB: Page may be a transaction system page 2023-09-15T14:33:15.169775Z 1 [ERROR] [MY-011899] [InnoDB] [FATAL] Unable to read page [page id: space=0, page number=5] into the buffer pool after 100 attempts. The most probable cause of this error may be that the table has been corrupted. Or, the table was compressed with with an algorithm that is not supported by this instance. If it is not a decompress failure, you can try to fix this problem by using innodb_force_recovery. Please see http://dev.mysql.com/doc/refman/8.0/en/ for more details. Aborting... 2023-09-15T14:33:15.169807Z 1 [ERROR] [MY-013183] [InnoDB] Assertion failure: buf0buf.cc:4054:ib::fatal triggered thread 140275780638464 InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 2023-09-15T14:33:15Z UTC - mysqld got signal 6 ; Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware. BuildID[sha1]=b0a6398207071378976beb42c50ef89be92e92db Thread pointer: 0x5580f6f1c3f0 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 = 7f9480134be0 thread_stack 0x100000 /usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x5580f29d9e71] /usr/sbin/mysqld(print_fatal_signal(int)+0x39b) [0x5580f184efab] /usr/sbin/mysqld(my_server_abort()+0x76) [0x5580f184f0f6] /usr/sbin/mysqld(my_abort()+0xe) [0x5580f29d3e0e] /usr/sbin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x349) [0x5580f2c77929] /usr/sbin/mysqld(ib::fatal::~fatal()+0xd5) [0x5580f2c7a165] /usr/sbin/mysqld(Buf_fetch<Buf_fetch_normal>::read_page()+0x1aa) [0x5580f2ce2fba] /usr/sbin/mysqld(Buf_fetch_normal::get(buf_block_t*&)+0x170) [0x5580f2ceec20] /usr/sbin/mysqld(Buf_fetch<Buf_fetch_normal>::single_page()+0x59) [0x5580f2ceed09] /usr/sbin/mysqld(buf_page_get_gen(page_id_t const&, page_size_t const&, unsigned long, buf_block_t*, Page_fetch, ut::Location, mtr_t*, bool)+0x1fa) [0x5580f2cf02ea] /usr/sbin/mysqld(Double_write::get(mtr_t*)+0x56) [0x5580f2cf3c56] /usr/sbin/mysqld(Double_write::init_v1(unsigned int&, unsigned int&)+0x11b) [0x5580f2cf8c1b] /usr/sbin/mysqld(dblwr::v1::init()+0x1b) [0x5580f2cf8e2b] /usr/sbin/mysqld(srv_start(bool)+0x1471) [0x5580f2c166a1] /usr/sbin/mysqld(+0x2349496) [0x5580f2a1d496] /usr/sbin/mysqld(dd::bootstrap::DDSE_dict_init(THD*, dict_init_mode_t, unsigned int)+0x9e) [0x5580f27564ae] /usr/sbin/mysqld(dd::upgrade_57::do_pre_checks_and_initialize_dd(THD*)+0x1a9) [0x5580f29abf89] /usr/sbin/mysqld(+0x1240896) [0x5580f1914896] /usr/sbin/mysqld(+0x289d0fd) [0x5580f2f710fd] /lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7f94a20cb609] /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f94a1c9c133] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0): is an invalid pointer Connection ID (thread ID): 1 Status: NOT_KILLED 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.
我猜测问题最初是由硬盘满了导致的。我尝试恢复服务器的旧备份,但手头最早的备份似乎已经存在这个问题了。
我现在完全陷入僵局,不知道该怎么办了。还有什么办法可以尝试吗?
备注:内容来源于stack exchange,提问作者Sulli
相关产品推荐
相关产品推荐

