Tablespace 'innodb_system' Page [page id: space=0, page number=5] log sequence number 2243306228 is in the future! Current system log sequence number 2243305813.

场景:

  这几天在外面实习,老师的项目数据库崩了让我看,连着两条看到十一二点,哎。

  主要场景是mysql突然崩溃,发现重启mysqld服务无效,重启系统无效。查看/var/log/mysql.log日志,看到以下内容:

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.
2023-04-26T02:58:51.457876Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.27) starting as process 2885
2023-04-26T02:58:51.489049Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-26T02:58:53.107900Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_002' Page [page id: space=4294967278, page number=86] log sequence number 2243554633 is in the future! Current system log sequence number 2243439748.
2023-04-26T02:58:53.107987Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2023-04-26T02:58:53.108163Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_002' Page [page id: space=4294967278, page number=198] log sequence number 2243516362 is in the future! Current system log sequence number 2243439748.
2023-04-26T02:58:53.108202Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2023-04-26T02:58:53.108388Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_002' Page [page id: space=4294967278, page number=82] log sequence number 2243515454 is in the future! Current system log sequence number 2243439748.
2023-04-26T02:58:53.108420Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2023-04-26T02:58:53.108474Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_002' Page [page id: space=4294967278, page number=195] log sequence number 2243515454 is in the future! Current system log sequence number 2243439748.
2023-04-26T02:58:53.108508Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2023-04-26T02:58:53.108613Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_002' Page [page id: space=4294967278, page number=550] log sequence number 2243515454 is in the future! Current system log sequence number 2243439748.
2023-04-26T02:58:53.108650Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2023-04-26T02:58:53.241299Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_001' Page [page id: space=4294967279, page number=200] log sequence number 2243554270 is in the future! Current system log sequence number 2243439748.
2023-04-26T02:58:53.241416Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2023-04-26T02:58:53.241552Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_001' Page [page id: space=4294967279, page number=199] log sequence number 2243515924 is in the future! Current system log sequence number 2243439748.
2023-04-26T02:58:53.241599Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2023-04-26T02:58:53.357605Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-26T02:58:54.736987Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: fut0lst.ic:85:addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA thread 139700975163136
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.
02:58:54 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x7f0e980008c0
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 = 7f0eaaffcb30 thread_stack 0x100000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x1fc33ad]
/usr/sbin/mysqld(handle_fatal_signal+0x30b) [0xee902b]
/lib64/libpthread.so.0(+0xf630) [0x7f0eef24e630]
/lib64/libc.so.6(gsignal+0x37) [0x7f0eed798387]
/lib64/libc.so.6(abort+0x148) [0x7f0eed799a78]
/usr/sbin/mysqld() [0xc3378c]
/usr/sbin/mysqld() [0x2225bfa]
/usr/sbin/mysqld() [0x222699c]
/usr/sbin/mysqld(trx_purge(unsigned long, unsigned long, bool)+0xf9) [0x2226fd9]
/usr/sbin/mysqld(srv_purge_coordinator_thread()+0x542) [0x21ffe52]
/usr/sbin/mysqld(std::thread::_State_impl<std::thread::_Invoker<std::tuple<Detached_thread, void (*)()> > >::_M_run()+0xc0) [0x2144d30]
/usr/sbin/mysqld() [0x2768100]
/lib64/libpthread.so.0(+0x7ea5) [0x7f0eef246ea5]
/lib64/libc.so.6(clone+0x6d) [0x7f0eed860b0d]


......

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 0
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.
2023-04-26T14:01:04.902755Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.27) starting as process 25053
2023-04-26T14:01:04.915843Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-26T14:01:05.880916Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-04-26T14:01:06.272806Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: fut0lst.ic:85:addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA thread 139919917815552
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.
14:01:06 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x7f41840008c0
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 = 7f41a4ff8b30 thread_stack 0x100000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x1fc33ad]
/usr/sbin/mysqld(handle_fatal_signal+0x30b) [0xee902b]
/lib64/libpthread.so.0(+0xf630) [0x7f41ec6b1630]
/lib64/libc.so.6(gsignal+0x37) [0x7f41eabfb387]
/lib64/libc.so.6(abort+0x148) [0x7f41eabfca78]
/usr/sbin/mysqld() [0xc3378c]
/usr/sbin/mysqld() [0x2225bfa]
/usr/sbin/mysqld() [0x222699c]
/usr/sbin/mysqld(trx_purge(unsigned long, unsigned long, bool)+0xf9) [0x2226fd9]
/usr/sbin/mysqld(srv_purge_coordinator_thread()+0x542) [0x21ffe52]
/usr/sbin/mysqld(std::thread::_State_impl<std::thread::_Invoker<std::tuple<Detached_thread, void (*)()> > >::_M_run()+0xc0) [0x2144d30]
/usr/sbin/mysqld() [0x2768100]
/lib64/libpthread.so.0(+0x7ea5) [0x7f41ec6a9ea5]
/lib64/libc.so.6(clone+0x6d) [0x7f41eacc3b0d]

  其中最早的报错是:

Tablespace 'innodb_undo_002' Page [page id: space=4294967278, page number=86] log sequence number 2243554633 is in the future! Current system log sequence number 2243439748.

  由于系统是装在公司Windows的虚拟机上的(这个也离谱),猜测可能是硬件异常断电导致的,但实际没有得到验证。

解决:

  打算先备份数据库,然后重新安装mysql。

  因为之前从没备份过,所以赶紧设置InnoDB的备份参数。编辑/etc/my.cnf,添加以下代码:

innodb_force_recovery = 3

  这个参数的值为0-6,默认为0。从1开始一个个试过去,看能不能启动。一般在3的时候就可以启动mysql了,此时不能进行插入、删除、修改等操作,赶紧备份数据库。

  重装数据库。

  顺便在重装的时候遇到一个问题:reading initial communication packet

  是本地可以连接mysql,但是用navicat远程连接不上。可以试试以下操作:

  1. 在/etc/my.cnf文件中添加:

bind-address=0.0.0.0

  2.开放mysql远程连接,注意这个修改密码不同版本语句不一样

mysql -u root -p;
use mysql;
update user set Host='%' where User='root'; 
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
flush privileges;

  3.我一开始用navicat是用ssh连接,发现怎么都登不上去,后来不用ssh就行。晕死

  其他:在重装之前也看了蛮多帖子的,都试了一下发现还是不行,最后还是重装。有没有办法不重装mysql就能恢复呢?希望能交流一下。

参考:

https://blog.csdn.net/oThrowsException/article/details/120290545

https://blog.csdn.net/qq_40907977/article/details/114842270

https://www.it1352.com/2131538.html

https://www.cnblogs.com/besehen/p/16056006.html

posted @ 2023-04-27 23:09  陈子白  阅读(1447)  评论(0编辑  收藏  举报