首页 > 数据库 >异常断电导致mysql数据库损坏,无法启动mysql进程

异常断电导致mysql数据库损坏,无法启动mysql进程

时间:2024-12-27 17:34:54浏览次数:7  
标签:12 23 数据库 断电 InnoDB mysql 26T08 MY

起因:

昨天公司意外停电,今天打开zabbix服务器,web登录管理后台时,提示Database error无法登录了,在服务器上执行 sudo systemctl start mysql.service也报错

 

解决思路:

1、sudo tail -f -n 100 /var/log/zabbix/zabbix_server.log    查看zabbix-server日志,报错信息如下图

 

2、sudo tail -f -n 300 /var/log/mysql/error.log   查看mysql日志,报错信息如下,查资料说是数据页损坏导致mysql进程起不来

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.
2024-12-26T08:23:42.743810Z 0 [System] [MY-013951] [Server] 2024-12-26T08:23:42Z UTC - mysqld got signal 6 ;
2024-12-26T08:23:42.743811Z 0 [System] [MY-013951] [Server] Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
2024-12-26T08:23:42.743812Z 0 [System] [MY-013951] [Server] BuildID[sha1]=47ccd7ae44d1ac1ee8e570cb62c9ef678ae7ec63
2024-12-26T08:23:42.743813Z 0 [System] [MY-013951] [Server] Thread pointer: 0x5640e4a46960
2024-12-26T08:23:42.743814Z 0 [System] [MY-013951] [Server] Attempting backtrace. You can use the following information to find out
2024-12-26T08:23:42.743815Z 0 [System] [MY-013951] [Server] where mysqld died. If you see no messages after this, something went
2024-12-26T08:23:42.743816Z 0 [System] [MY-013951] [Server] terribly wrong...
2024-12-26T08:23:42.743817Z 0 [System] [MY-013951] [Server] stack_bottom = 7f30165d9ba0 thread_stack 0x100000
2024-12-26T08:23:42.743818Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x5640b6b2e4b1]
2024-12-26T08:23:42.743819Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(print_fatal_signal(int)+0x39b) [0x5640b599c15b]
2024-12-26T08:23:42.743820Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(my_server_abort()+0x76) [0x5640b599c2a6]
2024-12-26T08:23:42.743821Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(my_abort()+0xe) [0x5640b6b2843e]
2024-12-26T08:23:42.743822Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x349) [0x5640b6dd0e19]
2024-12-26T08:23:42.743823Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(flst_insert_before(unsigned char*, unsigned char*, unsigned char*, mtr_t*)+0x138) [0x5640b6fab698]
2024-12-26T08:23:42.743824Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(flst_add_first(unsigned char*, unsigned char*, mtr_t*)+0x99) [0x5640b6fab9c9]
2024-12-26T08:23:42.743825Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(trx_purge_add_update_undo_to_history(trx_t*, trx_undo_ptr_t*, unsigned char*, bool, unsigned long, mtr_t*)+0x142) [0x5640b6d85b42]
2024-12-26T08:23:42.743826Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(trx_undo_update_cleanup(trx_t*, trx_undo_ptr_t*, unsigned char*, bool, unsigned long, mtr_t*)+0x23) [0x5640b6dca2f3]
2024-12-26T08:23:42.743827Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(+0x25af008) [0x5640b6dbf008]
2024-12-26T08:23:42.743828Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(trx_commit_low(trx_t*, mtr_t*)+0x4e) [0x5640b6dc162e]
2024-12-26T08:23:42.743829Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(trx_commit(trx_t*)+0x12d) [0x5640b6dc1d3d]
2024-12-26T08:23:42.743830Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(trx_rollback_or_clean_recovered(bool)+0x114f) [0x5640b6da167f]
2024-12-26T08:23:42.743831Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(srv_dict_recover_on_restart()+0x469) [0x5640b6d6e5d9]
2024-12-26T08:23:42.743832Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(+0x23726d1) [0x5640b6b826d1]
2024-12-26T08:23:42.743833Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(+0x208e7b2) [0x5640b689e7b2]
2024-12-26T08:23:42.743834Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(dd::bootstrap::restart(THD*)+0x11a) [0x5640b68acfea]
2024-12-26T08:23:42.743835Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(+0x22eaf71) [0x5640b6afaf71]
2024-12-26T08:23:42.743836Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(dd::upgrade_57::do_pre_checks_and_initialize_dd(THD*)+0xb38) [0x5640b6b00e48]
2024-12-26T08:23:42.743837Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(+0x1251ace) [0x5640b5a61ace]
2024-12-26T08:23:42.743838Z 0 [System] [MY-013951] [Server] /usr/sbin/mysqld(+0x28baead) [0x5640b70caead]
2024-12-26T08:23:42.743839Z 0 [System] [MY-013951] [Server] /lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7f3025766609]
2024-12-26T08:23:42.743840Z 0 [System] [MY-013951] [Server] /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f3025337353]
2024-12-26T08:23:42.743841Z 0 [System] [MY-013951] [Server] Trying to get some variables.
2024-12-26T08:23:42.743842Z 0 [System] [MY-013951] [Server] Some pointers may be invalid and cause the dump to abort.
2024-12-26T08:23:42.743843Z 0 [System] [MY-013951] [Server] Query (0): is an invalid pointer
2024-12-26T08:23:42.743844Z 0 [System] [MY-013951] [Server] Connection ID (thread ID): 1
2024-12-26T08:23:42.743845Z 0 [System] [MY-013951] [Server] Status: NOT_KILLED
2024-12-26T08:23:42.743846Z 0 [System] [MY-013951] [Server] The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
2024-12-26T08:23:42.743847Z 0 [System] [MY-013951] [Server] information that should help you find out what is causing the crash.
2024-12-26T08:23:43.475858Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40-0ubuntu0.20.04.1) starting as process 232119
2024-12-26T08:23:43.478293Z 0 [System] [MY-013951] [Server] A backtrace was processed and added to the main error-log in the appropriate format.
2024-12-26T08:23:43.482469Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-26T08:23:46.440823Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_002' Page [page id: space=4294967024, page number=15] log sequence number 1265587524879 is in the future! Current system log sequence number 1265587394335.
2024-12-26T08:23:46.440871Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.440894Z 0 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_undo_002' Page [page id: space=4294967024, page number=5199] log sequence number 1265587524879 is in the future! Current system log sequence number 1265587394335.
2024-12-26T08:23:46.440902Z 0 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.510409Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-12-26T08:23:46.612495Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=1411] log sequence number 1265587915653 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.612532Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.624564Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=84] log sequence number 1265587914314 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.624603Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.624733Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=85] log sequence number 1265587914330 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.624747Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.624866Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=86] log sequence number 1265587914346 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.624878Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.624954Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=87] log sequence number 1265587914362 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.624965Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.625047Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=88] log sequence number 1265587914378 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.625058Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.625143Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=90] log sequence number 1265587914394 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.625158Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.625213Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=91] log sequence number 1265587914410 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.625220Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.625270Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=92] log sequence number 1265587717407 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.625276Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.651531Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'mysql' Page [page id: space=4294967294, page number=754] log sequence number 1265587915687 is in the future! Current system log sequence number 1265587394345.
2024-12-26T08:23:46.651564Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB redo log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
2024-12-26T08:23:46.702710Z 1 [ERROR] [MY-013183] [InnoDB] Assertion failure: fut0lst.ic:82:addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA thread 139962573821696
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.
2024-12-26T08:23:46Z UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=47ccd7ae44d1ac1ee8e570cb62c9ef678ae7ec63
Thread pointer: 0x55f0ae1498a0
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 = 7f4b937e8ba0 thread_stack 0x100000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x55f0799144b1]
/usr/sbin/mysqld(print_fatal_signal(int)+0x39b) [0x55f07878215b]
/usr/sbin/mysqld(my_server_abort()+0x76) [0x55f0787822a6]
/usr/sbin/mysqld(my_abort()+0xe) [0x55f07990e43e]
/usr/sbin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x349) [0x55f079bb6e19]
/usr/sbin/mysqld(flst_insert_before(unsigned char*, unsigned char*, unsigned char*, mtr_t*)+0x138) [0x55f079d91698]
/usr/sbin/mysqld(flst_add_first(unsigned char*, unsigned char*, mtr_t*)+0x99) [0x55f079d919c9]
/usr/sbin/mysqld(trx_purge_add_update_undo_to_history(trx_t*, trx_undo_ptr_t*, unsigned char*, bool, unsigned long, mtr_t*)+0x142) [0x55f079b6bb42]
/usr/sbin/mysqld(trx_undo_update_cleanup(trx_t*, trx_undo_ptr_t*, unsigned char*, bool, unsigned long, mtr_t*)+0x23) [0x55f079bb02f3]
/usr/sbin/mysqld(+0x25af008) [0x55f079ba5008]
/usr/sbin/mysqld(trx_commit_low(trx_t*, mtr_t*)+0x4e) [0x55f079ba762e]
/usr/sbin/mysqld(trx_commit(trx_t*)+0x12d) [0x55f079ba7d3d]
/usr/sbin/mysqld(trx_rollback_or_clean_recovered(bool)+0x114f) [0x55f079b8767f]
/usr/sbin/mysqld(srv_dict_recover_on_restart()+0x469) [0x55f079b545d9]
/usr/sbin/mysqld(+0x23726d1) [0x55f0799686d1]
/usr/sbin/mysqld(+0x208e7b2) [0x55f0796847b2]
/usr/sbin/mysqld(dd::bootstrap::restart(THD*)+0x11a) [0x55f079692fea]
/usr/sbin/mysqld(+0x22eaf71) [0x55f0798e0f71]
/usr/sbin/mysqld(dd::upgrade_57::do_pre_checks_and_initialize_dd(THD*)+0xb38) [0x55f0798e6e48]
/usr/sbin/mysqld(+0x1251ace) [0x55f078847ace]
/usr/sbin/mysqld(+0x28baead) [0x55f079eb0ead]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7f4ba2975609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f4ba2546353]

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

 

3、sudo systemctl stop mysql.service    先停掉mysql进程

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf    修改mysql配置文件

找到 [mysqld] 这行,新起一行,写上 innodb_force_recovery = 6

建议大家从最小的开始尝试,1到6依次启动,我这里试了1-5都启动不了,拉到6后再启动mysql报错信息变了,下表是各值的定义,大的值包含前面值的所有功能

innodb_force_recovery相关值说明:

1 (SRV_FORCE_IGNORE_CORRUPT): 忽略检查到的 corrupt 页。尽管检测到了损坏的 page 仍强制服务运行。一般设置为该值即可,然后 dump 出库表进行重建。

2 (SRV_FORCE_NO_BACKGROUND): 阻止主线程的运行,如主线程需要执行 full purge 操作,会导致 crash。阻止 master thread 和任何 purge thread 运行。若 crash 发生在 purge 环节则使用该值。

3 (SRV_FORCE_NO_TRX_UNDO): 不执行事务回滚操作。

4 (SRV_FORCE_NO_IBUF_MERGE): 不执行插入缓冲的合并操作。如果可能导致崩溃则不要做这些操作。不要进行统计操作。该值可能永久损坏数据文件。若使用了该值,则将来要删除和重建辅助索引。

5 (SRV_FORCE_NO_UNDO_LOG_SCAN): 不查看重做日志,InnoDB 存储引擎会将未提交的事务视为已提交。此时 InnoDB 甚至把未完成的事务按照提交处理。该值可能永久性的损坏数据文件。

6 (SRV_FORCE_NO_LOG_REDO): 不执行前滚的操作。恢复时不做 redo log roll-forward。使数据库页处于废止状态,继而可能引起 B 树或者其他数据库结构更多的损坏。
另外从 MySQL 5.7.18 开始, DROP TABLE不允许使用 innodb_force_recovery大于 4 的值。

 

4、这是将 innodb_force_recovery = 6 后启动mysql的报错信息

2023-06-18T06:54:36.303799Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 245732
2023-06-18T06:54:36.327091Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-18T06:54:36.477605Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 13 in a file operation.
2023-06-18T06:54:36.477737Z 1 [ERROR] [MY-012595] [InnoDB] The error means mysqld does not have the access rights to the directory.
2023-06-18T06:54:36.477784Z 1 [ERROR] [MY-013861] [InnoDB] Failed to list redo log files in the redo log directory ./#innodb_redo/
2023-06-18T06:54:36.477818Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2023-06-18T06:54:36.977241Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2023-06-18T06:54:36.977698Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-06-18T06:54:36.977775Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-06-18T06:54:36.978828Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.33-0ubuntu0.22.04.2)  (Ubuntu).
2023-06-18T06:55:52.674359Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 246207
2023-06-18T06:55:52.695800Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-18T06:55:52.995102Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-06-18T06:55:53.180839Z 1 [Warning] [MY-011018] [InnoDB] Skip updating information_schema metadata in InnoDB read-only mode.
2023-06-18T06:55:53.180982Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in InnoDB read-only mode.
2023-06-18T06:55:53.193052Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
2023-06-18T06:55:53.193629Z 2 [Warning] [MY-011018] [Server] Skip updating information_schema metadata in InnoDB read-only mode.
2023-06-18T06:55:53.195263Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
2023-06-18T06:55:53.195363Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
2023-06-18T06:55:53.195436Z 0 [Warning] [MY-010970] [Server] Skipped updating resource group metadata in InnoDB read only mode.
mysqld: File 'allet","version":"0.41.2"}]' not found (OS errno 2 - No such file or directory)
2023-06-18T06:55:53.430576Z 0 [ERROR] [MY-010958] [Server] Could not open log file.
2023-06-18T06:55:53.430634Z 0 [ERROR] [MY-010041] [Server] Can't init tc log
2023-06-18T06:55:53.430665Z 0 [ERROR] [MY-010119] [Server] Aborting

 

5、备份sudo cp /var/lib/mysql/binlog.index ./ 文件后,然后删除该文件 sudo rm /var/lib/mysql/binlog.index

 

6、sudo systemctl restart mysql  重启mysql服务,终于起来了

 

7、mysql -uroot -p  报错无法进入数据库,解决方法请查看此文 https://www.cnblogs.com/kn-zheng/p/17420695.html

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

 

8、登录zabbix管理后台,也报错了登不进去

 

 9、我用sql语句查询损坏的表空间,得到如下,我也不是很懂数据库

mysql> select * from information_schema.INNODB_TABLES where SPACE = 4294967294;
+----------+------------------------------------------------------------+------+--------+------------+------------+-------                                                                                                   --------+------------+--------------+--------------------+
| TABLE_ID | NAME                                                       | FLAG | N_COLS | SPACE      | ROW_FORMAT | ZIP_PA                                                                                                   GE_SIZE | SPACE_TYPE | INSTANT_COLS | TOTAL_ROW_VERSIONS |
+----------+------------------------------------------------------------+------+--------+------------+------------+-------                                                                                                   --------+------------+--------------+--------------------+
|     1054 | mysql/replication_group_configuration_version              |  161 |      5 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1440 | mysql/component                                            |  161 |      6 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1492 | mysql/columns_priv                                         |  161 |     10 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1493 | mysql/db                                                   |  161 |     25 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1494 | mysql/default_roles                                        |  161 |      7 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1495 | mysql/engine_cost                                          |  161 |      9 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1497 | mysql/global_grants                                        |  161 |      7 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1525 | mysql/help_category                                        |  161 |      7 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1526 | mysql/help_keyword                                         |  161 |      5 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1527 | mysql/help_relation                                        |  161 |      5 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1524 | mysql/help_topic                                           |  161 |      9 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1503 | mysql/plugin                                               |  161 |      5 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1504 | mysql/password_history                                     |  161 |      7 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1506 | mysql/proxies_priv                                         |  161 |     10 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1507 | mysql/role_edges                                           |  161 |      8 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1508 | mysql/servers                                              |  161 |     12 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1509 | mysql/server_cost                                          |  161 |      7 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1512 | mysql/replication_asynchronous_connection_failover         |  161 |      9 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1513 | mysql/replication_asynchronous_connection_failover_managed |  161 |      7 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1514 | mysql/replication_group_member_actions                     |  161 |      9 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1516 | mysql/tables_priv                                          |  161 |     11 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1518 | mysql/time_zone_name                                       |  161 |      5 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1519 | mysql/time_zone_leap_second                                |  161 |      5 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1520 | mysql/time_zone_transition                                 |  161 |      6 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1521 | mysql/time_zone_transition_type                            |  161 |      8 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1496 | mysql/func                                                 |  161 |      7 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1498 | mysql/gtid_executed                                        |  161 |      6 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1523 | mysql/slave_master_info                                    |  161 |     36 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1511 | mysql/slave_worker_info                                    |  161 |     16 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1515 | mysql/slave_relay_log_info                                 |  161 |     18 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1505 | mysql/procs_priv                                           |  161 |     11 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1522 | mysql/user                                                 |  161 |     54 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
|     1517 | mysql/time_zone                                            |  161 |      5 | 4294967294 | Dynamic    |                                                                                                                0 | General    |            0 |                  0 |
+----------+------------------------------------------------------------+------+--------+------------+------------+-------                                                                                                   --------+------------+--------------+--------------------+
33 rows in set (0.00 sec)

mysql> select * from information_schema.INNODB_TABLES where SPACE = 4294967024;
Empty set (0.01 sec)

 

10、折腾许久之后还是重装mysql,在重装之前也查了蛮多资料,都试了一下发现还是不行,有没有办法不重装mysql就能恢复的呢?希望有大佬可以交流一下。

https://www.cnblogs.com/luoguixin/p/16402080.html

https://www.cnblogs.com/chenzibai/p/17360512.html

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

https://mp.weixin.qq.com/s/l6KZP4glnwwuDQxU98A0Mw

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

https://www.cnblogs.com/cheyunhua/p/18468497

https://blog.csdn.net/qq_42768234/article/details/135271263

https://blog.csdn.net/q195136130/article/details/131272971

https://binghe.blog.csdn.net/article/details/77199194?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-3-77199194-blog-5570950.235%5Ev43%5Epc_blog_bottom_relevance_base1&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-3-77199194-blog-5570950.235%5Ev43%5Epc_blog_bottom_relevance_base1&utm_relevant_index=6

标签:12,23,数据库,断电,InnoDB,mysql,26T08,MY
From: https://www.cnblogs.com/xiykj/p/18636320

相关文章

  • 查询数据库开始时间和结束时间字段中包括了给定时间区间的数据
    表数据示例: 查询区间:2024-12-0310:00:00-2024-12-0618:00:00 mysql示例:SELECT*FROMtime_testWHERE((start_time>'2024-12-0310:00:00'AND('2024-12-0618:00:00'>end_timeOR('2024-12-0618:00:00'>start_time......
  • Mysql锁
    Mysql锁行锁InnoDB存储引擎中的行锁机制是通过多种类型的锁来实现的,以确保事务的隔离性和并发性。以下是InnoDB中主要的行锁类型:记录锁(RecordLock):记录锁是最基本的行锁形式,它锁定索引记录。例如,如果你对某个主键执行SELECT...FORUPDATE或UPDATE操作,那么你将获得该主键......
  • Oracle数据库关于日期TO_DATE的用法
    1、在Oracle数据库中,常用的日期格式,比如获取当前时间SELECTSYSDATEAS当前时间FROMDUAL; 2、稽核本月第一天的数据至今,日期获取如下SELECTTRUNC(SYSDATE,'MM')AS当月第一天 FROMDUAL; 3、日期时间格式selectto_date('2021/7/123:59:59','yyyy/mm/ddhh24:mi......
  • 使用NotionDBLoader从Notion数据库加载内容的技术指南
    文章目录概要整体架构流程技术名词解释技术细节小结概要提示:这里可以添加技术概要例如:openAI的GPT大模型的发展历程。整体架构流程提示:这里可以添加技术整体架构例如:在语言模型中,编码器和解码器都是由一个个的Transformer组件拼接在一起形成的。技术......
  • Python作业有效性评价系统(Pycharm Flask Django Vue mysql)
    文章目录项目介绍和开发技术介绍具体实现截图开发技术开发与测试:设计思路系统测试可行性分析核心代码部分展示文章目录/写作提纲参考源码/演示视频获取方式项目介绍和开发技术介绍通过开发人员和系统使用方的沟通,本系统的用户主要有如下几类,教师和学生。(1)教师子系......
  • kingbase金仓数据库之对象访问权限的管理
    基础知识对象的分类数据库的表、索引、视图、缺省值、规则、触发器等等,都称为数据库对象,对象分为如下两类:模式(SCHEMA)对象:可以理解为一个存储目录,包含视图、索引、数据类型、函数和操作符等。非模式对象:其他的数据库对象,如数据库、表空间、用户。对象访问权限概述1......
  • MySQL 备份和恢复
    1.备份恢复概述1.1为什么要备份灾难恢复:硬件故障、软件故障、自然灾害、黑客攻击、误操作测试等数据丢失场景参考链接:https://www.toutiao.com/a6939518201961251359/1.2备份类型完全备份,部分备份完全备份:整个数据集部分备份:只备份数据子集,如部分库或表完全备份、增......
  • 基于Python的医疗大模型落地:面向数据库编程驱动医疗大模型轻量化变革
    一、引言1.1研究背景与意义随着医疗大模型在医疗领域的广泛应用,其在辅助医疗决策、疾病诊断、药物研发等方面发挥着重要作用。然而,医疗大模型在落地过程中面临诸多困境,如数据隐私保护、模型复杂导致成本高昂以及基层医疗适配性差等问题。与此同时,PostgreSQL凭借其强大的数......
  • 欧拉OpenEuler安装MySQL8
    1.安装mysqltar-xvfmysql-8.0.21-linux-glibc2.12-x86_64.tarmvmysql-8.0.21-linux-glibc2.12-x86_64/usr/local/mysql2.配置mysqlvim/etc/my.cnf[client]default-character-set=utf8mb4[mysqld]#nd-address=0.0.0.0port=3306user=mysqlbasedir=/usr/local/m......
  • 免费送源码:Java+springboot+MySQL 房屋租赁系统小程序的设计与实现 计算机毕业设计原
    目 录摘要11绪论11.1选题意义11.2开发现状11.3springboot框架介绍11.4论文结构与章节安排12 房屋租赁系统小程序系统分析32.1可行性分析32.1.1技术可行性分析32.1.2经济可行性分析32.1.3法律可行性分析32.2系统功能分析32.2.1功能性分析......