当前位置: 首页 > news >正文

MySQL奔溃,InnoDB文件损坏修复记录

报错日志文件:


-----------------------------------------161108 23:36:45 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var2019-12-01 23:36:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2019-12-01 23:36:46 5497 [Note] Plugin 'FEDERATED' is disabled.2019-12-01 23:36:46 7f11c48e1720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.2019-12-01 23:36:46 5497 [Note] InnoDB: Using atomics to ref count buffer pool pages2019-12-01 23:36:46 5497 [Note] InnoDB: The InnoDB memory heap is disabled2019-12-01 23:36:46 5497 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2019-12-01 23:36:46 5497 [Note] InnoDB: Memory barrier is not used2019-12-01 23:36:46 5497 [Note] InnoDB: Compressed tables use zlib 1.2.32019-12-01 23:36:46 5497 [Note] InnoDB: Using CPU crc32 instructions2019-12-01 23:36:46 5497 [Note] InnoDB: Initializing buffer pool, size = 16.0M2019-12-01 23:36:46 5497 [Note] InnoDB: Completed initialization of buffer poolInnoDB: Database page corruption on disk or a failedInnoDB: file read of page 5.InnoDB: You may have to recover from a backup.2019-12-01 23:36:46 7f11c48e1720 InnoDB: Page dump in ascii and hex (16384 bytes):len 16384; hex 7478d078000000050000000000000000000000000f271f4d000700000000000000000000000000000000001b4000000000000000000200f20000000000000006000000000000002d000000000000002e000000000000002f0000000000000030000000000(省略很多类似代码)InnoDB: End of page dump2019-12-01 23:36:46 7f11c48e1720 InnoDB: uncompressed page, stored checksum in field1 1954074744, calculated checksums for field1: crc32 993334256, innodb 2046145943, none 3735928559, stored checksum in field2 1139795846, calculated checksums for field2: crc32 993334256, innodb 1606613742, none 3735928559, page LSN 0 254222157, low 4 bytes of LSN at page end 254221236, page number (if stored to page already) 5, space id (if created with >= MySQL-4.1.1 and stored already) 0InnoDB: Page may be a transaction system pageInnoDB: Database page corruption on disk or a failedInnoDB: file read of page 5.InnoDB: You may have to recover from a backup.InnoDB: It is also possible that your operatingInnoDB: system has corrupted its own file cacheInnoDB: and rebooting your computer removes theInnoDB: error.InnoDB: If the corrupt page is an index pageInnoDB: you can also try to fix the corruptionInnoDB: by dumping, dropping, and reimportingInnoDB: the corrupt table. You can use CHECKInnoDB: TABLE to scan your table for corruption.InnoDB: See also http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.htmlInnoDB: about forcing recovery.InnoDB: Ending processing because of a corrupt database page.2019-12-01 23:36:46 7f11c48e1720  InnoDB: Assertion failure in thread 139714288817952 in file buf0buf.cc line 4201InnoDB: 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, evenInnoDB: immediately after the mysqld startup, there may beInnoDB: corruption in the InnoDB tablespace. Please refer toInnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.htmlInnoDB: about forcing recovery.03:36:46 UTC - mysqld got signal 6 ;This could be because you hit a bug. It is also possible that this binaryor 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 helpdiagnose the problem, but since we have already crashed,something is definitely wrong and this may fail.key_buffer_size=16777216read_buffer_size=262144max_used_connections=0max_threads=1000thread_count=0connection_count=0It is possible that mysqld could use up tokey_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 798063 K  bytes of memoryHope that's ok; if not, decrease some variables in the equation.Thread pointer: 0x0Attempting backtrace. You can use the following information to find outwhere mysqld died. If you see no messages after this, something wentterribly wrong...stack_bottom = 0 thread_stack 0x40000/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x8e64b5]/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x41b)[0x652fbb]/lib64/libpthread.so.0(+0xf7e0)[0x7f11c44c77e0]/lib64/libc.so.6(gsignal+0x35)[0x7f11c315d625]/lib64/libc.so.6(abort+0x175)[0x7f11c315ee05]/usr/local/mysql/bin/mysqld[0xa585c5]/usr/local/mysql/bin/mysqld[0xa6c7b4]/usr/local/mysql/bin/mysqld[0xa6cbc7]/usr/local/mysql/bin/mysqld[0xa5bce2]/usr/local/mysql/bin/mysqld[0xa1e2ba]/usr/local/mysql/bin/mysqld[0xa0bf60]/usr/local/mysql/bin/mysqld[0x95a427]/usr/local/mysql/bin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x48)[0x58f788]/usr/local/mysql/bin/mysqld[0x6e4a36]/usr/local/mysql/bin/mysqld(_Z11plugin_initPiPPci+0xb3e)[0x6e826e]/usr/local/mysql/bin/mysqld[0x582d85]/usr/local/mysql/bin/mysqld(_Z11mysqld_mainiPPc+0x4d8)[0x587d18]/lib64/libc.so.6(__libc_start_main+0xfd)[0x7f11c3149d5d]/usr/local/mysql/bin/mysqld[0x57a019]The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html containsinformation that should help you find out what is causing the crash.161108 23:36:46 mysqld_safe mysqld from pid file /usr/local/mysql/var/VM_241_49_centos.pid ended------------------------------------------------------------------------------

修复方法:

1、修改 my.cnf 配置文件

[mysqld]
# 可以是 1-6 几个数字,重启MySQL
innodb_force_recovery = 6 

2、备份数据库、删除原数据

mysqldump -uroot -p123 test > test.sql

删除 MySQL数据目录下,对应数据库文件夹下的所有文件(前提是确保已成功备份),最好的做法是在目录下创建一个 backup 的文件夹,将所有文件移动到这个目录

3、将 ib_logfile0、ib_logfile1、ibdata1 移动到 backup 文件夹

mkdir backup
mv ib_logfile* backup
mv ibdata1 backup

4、将 my.cnf 中innodb_force_recovery = 1 或 2-6几个数字这行配置删除或者配置为innodb_force_recovery = 0,重启MySQL服务

5、将数据导入MySQL数据库

mysql -uroot -p123 test < test.sql

http://www.dtcms.com/a/346765.html

相关文章:

  • [2025CVPR-目标检测方向]PointSR:用于无人机视图物体检测的自正则化点监控
  • 尤弥尔传奇能够进行挂机搬砖吗?
  • AI实现超级客户端打印 支持APP 网页 小程序 调用本地客户端打印
  • 爬小红书图片软件:根据搜索关键词,采集笔记图片、正文、评论等
  • Angular初学者入门第三课——工厂函数(精品)
  • 游戏广告投放数据分析项目:拆解投放的“流量密码”
  • kail的浏览器连接不上网
  • 20250823给荣品RD-RK3588开发板刷Rockchip原厂的Buildroot【linux-5.10】时调通AP6275P的WIFI【源码部分】
  • 从 M4S 到 MP4:用 FFmpeg 轻松合并音视频文件
  • 达梦数据库统计信息收集
  • 无人机光伏巡检误检率↓79%!陌讯多模态融合算法在组件缺陷检测的落地优化
  • 【85页PPT】数字化转型LIMS大型企业智能制造之LIMS实验室管理系统产品解决方案(附下载方式)
  • webrtc弱网-SendSideBandwidthEstimation类源码分析与算法原理
  • 使用dism++备份系统时,出现“句柄无效”错误的解决方法
  • 重构实训生态:旅游管理虚拟仿真实训室的标准落地与价值创新
  • 某电器5G智慧工厂网络建设全解析
  • 【ABAP4】创建Package
  • 数字经济、全球化与5G催生域名新价值的逻辑与实践路径
  • Autosar CAN开发06(CAN通讯开发需求-CAN矩阵)
  • 突破传统文本切片的瓶颈:AntSK-FileChunk语义切片技术详解前言:为什么我们需要重新思考文本切片?
  • RHCSA--命令(二)
  • 一种通过模板输出Docx的方法
  • Agent Lightning:让任何AI智能体通过强化学习实现高效训练
  • 简单介绍计算机的工作过程
  • 深入理解 Linux 系统文件 I/O:从 open 到重定向的底层逻辑》
  • 力扣热题之技巧
  • 云计算核心技术之云网络技术
  • Agentic AI 知识框架整理
  • 08.23总结
  • FFMPEG相关解密,打水印,合并,推流,