MySQL : mysqld got signal 6 ,数据库无法启动

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
云数据库 RDS MySQL,高可用系列 2核4GB
简介:

本文主要描述MySQL服务器断电,启动之后,数据库无法启动,使用innodb_force_recovery=6进行恢复的案例。


欢迎转载,请注明作者、出处。

作者:张正
blog:http://space.itpub.net/26355921 
QQ:176036317
如有疑问,欢迎联系。

MySQL服务器遇断电,重启之后,数据库无法打开。具体报错信息如下:

140918 13:56:02 mysqld_safe Number of processes running now: 0

140918 13:56:02 mysqld_safe mysqld restarted

140918 13:56:02 InnoDB: The InnoDB memory heap is disabled

140918 13:56:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins

140918 13:56:02 InnoDB: Compressed tables use zlib 1.2.3

140918 13:56:02 InnoDB: Initializing buffer pool, size = 128.0M

140918 13:56:02 InnoDB: Completed initialization of buffer pool

140918 13:56:02 InnoDB: highest supported file format is Barracuda.

InnoDB: Log scan progressed past the checkpoint lsn 67376606

140918 13:56:02  InnoDB: Database was not shut down normally!

InnoDB: Starting crash recovery.

InnoDB: Reading tablespace information from the .ibd files...

InnoDB: Restoring possible half-written data pages from the doublewrite

InnoDB: buffer...

InnoDB: Doing recovery: scanned up to log sequence number 67712828

140918 13:56:02  InnoDB: Starting an apply batch of log records to the database...

InnoDB: Progress in percents: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

InnoDB: Apply batch completed

140918 13:56:03  InnoDB: Waiting for the background threads to start

140918 13:56:04 InnoDB: 1.1.8 started; log sequence number 67712828

140918 13:56:04 [Note] Recovering after a crash using /data/mysql/binlog/mysql-bin

140918 13:56:04 [Note] Starting crash recovery...

140918 13:56:04 [Note] Crash recovery finished.

140918 13:56:04  InnoDB: Assertion failure in thread 1245067584 in file trx0purge.c line 829

InnoDB: Failing assertion: purge_sys->purge_trx_no <= purge_sys->rseg->last_trx_no

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/5.5/en/forcing-innodb-recovery.html

InnoDB: about forcing recovery.

05:56:04 UTC - mysqld got signal 6 ;

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=8388608

read_buffer_size=131072

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 = 338489 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...

140918 13:56:04 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306

stack_bottom = 0 thread_stack 0x40000

/usr/local/mysql5.5/bin/mysqld(my_print_stacktrace+0x2e)[0x76ad1e]

140918 13:56:04 [Note]   - '0.0.0.0' resolves to '0.0.0.0';

140918 13:56:04 [Note] Server socket created on IP: '0.0.0.0'.

/usr/local/mysql5.5/bin/mysqld(handle_fatal_signal+0x386)[0x655ba6]

/lib64/libpthread.so.0[0x3519e0eb70]

/lib64/libc.so.6(gsignal+0x35)[0x3519230265]

/lib64/libc.so.6(abort+0x110)[0x3519231d10]

/usr/local/mysql5.5/bin/mysqld[0x7ab5d4]

/usr/local/mysql5.5/bin/mysqld[0x7ad219]

/usr/local/mysql5.5/bin/mysqld[0x86a3cf]

/usr/local/mysql5.5/bin/mysqld[0x8617ee]

/usr/local/mysql5.5/bin/mysqld[0x7aad55]

140918 13:56:04 [Warning] 'user' entry 'root@wordpress' ignored in --skip-name-resolve mode.

140918 13:56:04 [Warning] 'user' entry '@wordpress' ignored in --skip-name-resolve mode.

/usr/local/mysql5.5/bin/mysqld[0x79f070]

140918 13:56:04 [Warning] 'proxies_priv' entry '@ root@wordpress' ignored in --skip-name-resolve mode.

/usr/local/mysql5.5/bin/mysqld[0x7a2836]

/lib64/libpthread.so.0[0x3519e0673d]

/lib64/libc.so.6(clone+0x6d)[0x35192d44bd]

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.
看到这个报错,提示可能是由于表空间数据文件报错引起的无法进行前滚或回滚,从而数据库无法打开。
由于数据库整体文件不是太大,就几个G,因此尝试了将该数据文件拷贝到另一个地方,编辑好参数文件等一些列工作。(因为这份数据是拷贝,尝试这样做一下,做坏了耶不要紧。如果真实数据只有一份,可别上来就这么干,一定要分析清楚了问题所在,再动手。)
在参数文件中加入innodb_force_recovery=6 ,然后尝试启动mysqld,结果起来了。 这时候数据库只能进行查询,使用 mysqldump将数据导出,然后重新搭建一套新的环境。
至于断电后那部分的数据,可以尝试从binlog中解析一下,然后再对比数据库中,查看是否有丢失的数据,具体的 此处不再详述。

本文转自ITPUB博客84223932的博客,原文链接:MySQL : mysqld got signal 6 ,数据库无法启动,如需转载请自行联系原博主。

相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
相关文章
|
3月前
|
关系型数据库 MySQL 分布式数据库
阿里云PolarDB云原生数据库收费价格:MySQL和PostgreSQL详细介绍
阿里云PolarDB兼容MySQL、PostgreSQL及Oracle语法,支持集中式与分布式架构。标准版2核4G年费1116元起,企业版最高性能达4核16G,支持HTAP与多级高可用,广泛应用于金融、政务、互联网等领域,TCO成本降低50%。
|
3月前
|
关系型数据库 MySQL 数据库
阿里云数据库RDS费用价格:MySQL、SQL Server、PostgreSQL和MariaDB引擎收费标准
阿里云RDS数据库支持MySQL、SQL Server、PostgreSQL、MariaDB,多种引擎优惠上线!MySQL倚天版88元/年,SQL Server 2核4G仅299元/年,PostgreSQL 227元/年起。高可用、可弹性伸缩,安全稳定。详情见官网活动页。
|
3月前
|
关系型数据库 分布式数据库 数据库
阿里云数据库收费价格:MySQL、PostgreSQL、SQL Server和MariaDB引擎费用整理
阿里云数据库提供多种类型,包括关系型与NoSQL,主流如PolarDB、RDS MySQL/PostgreSQL、Redis等。价格低至21元/月起,支持按需付费与优惠套餐,适用于各类应用场景。
|
3月前
|
SQL 关系型数据库 MySQL
Mysql数据恢复—Mysql数据库delete删除后数据恢复案例
本地服务器,操作系统为windows server。服务器上部署mysql单实例,innodb引擎,独立表空间。未进行数据库备份,未开启binlog。 人为误操作使用Delete命令删除数据时未添加where子句,导致全表数据被删除。删除后未对该表进行任何操作。需要恢复误删除的数据。 在本案例中的mysql数据库未进行备份,也未开启binlog日志,无法直接还原数据库。
|
3月前
|
关系型数据库 MySQL 数据库
阿里云数据库RDS支持MySQL、SQL Server、PostgreSQL和MariaDB引擎
阿里云数据库RDS支持MySQL、SQL Server、PostgreSQL和MariaDB引擎,提供高性价比、稳定安全的云数据库服务,适用于多种行业与业务场景。
|
3月前
|
缓存 关系型数据库 BI
使用MYSQL Report分析数据库性能(下)
使用MYSQL Report分析数据库性能
135 3
|
3月前
|
关系型数据库 MySQL 数据库
自建数据库如何迁移至RDS MySQL实例
数据库迁移是一项复杂且耗时的工程,需考虑数据安全、完整性及业务中断影响。使用阿里云数据传输服务DTS,可快速、平滑完成迁移任务,将应用停机时间降至分钟级。您还可通过全量备份自建数据库并恢复至RDS MySQL实例,实现间接迁移上云。
|
4月前
|
存储 运维 关系型数据库
从MySQL到云数据库,数据库迁移真的有必要吗?
本文探讨了企业在业务增长背景下,是否应从 MySQL 迁移至云数据库的决策问题。分析了 MySQL 的优势与瓶颈,对比了云数据库在存储计算分离、自动化运维、多负载支持等方面的优势,并提出判断迁移必要性的五个关键问题及实施路径,帮助企业理性决策并落地迁移方案。
|
3月前
|
Ubuntu 安全 关系型数据库
安装与配置MySQL 8 on Ubuntu,包括权限授予、数据库备份及远程连接指南
以上步骤提供了在Ubuntu上从头开始设置、配置、授权、备份及恢复一个基础但完整的MySQL环境所需知识点。
410 7
|
3月前
|
缓存 监控 关系型数据库
使用MYSQL Report分析数据库性能(上)
最终建议:当前系统是完美的读密集型负载模型,优化重点应放在减少行读取量和提高数据定位效率。通过索引优化、分区策略和内存缓存,预期可降低30%的CPU负载,同时保持100%的缓冲池命中率。建议每百万次查询后刷新统计信息以持续优化
223 6

推荐镜像

更多