位置: 编程技术 - 正文
推荐整理分享完美解决mysql启动后随即关闭的问题(ibdata1文件损坏导致)(mysql 5.7启动),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:mysql启动失败怎么办,mysql5.5启动,mysql启动失败怎么办,mysql启动失败怎么办,mysql启动失败怎么办,mysql启动,mysql启动失败原因,mysql启动,内容如对您有帮助,希望把文章链接给更多的朋友!
机房一台服务器上的mysql运行一段时间了,突然出现了一个很奇怪的现象:重启后无法恢复了!准确情况是:启动mysql后随即就又关闭了。
查看mysql错误日志如下:
:: mysqld_safe Starting mysqld daemon with databases from /home/MysqlData/-- :: 0 [Note] /Data/app/mysql5.6./bin/mysqld (mysqld 5.6.-log) starting as process ...-- :: [Note] Plugin 'FEDERATED' is disabled.-- :: [Warning] option 'innodb-write-io-threads': unsigned value adjusted to -- :: [Warning] option 'innodb-read-io-threads': unsigned value adjusted to -- :: [Note] InnoDB: Using atomics to ref count buffer pool pages-- :: [Note] InnoDB: The InnoDB memory heap is disabled-- :: [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins-- :: [Note] InnoDB: Memory barrier is not used-- :: [Note] InnoDB: Compressed tables use zlib 1.2.-- :: [Note] InnoDB: Using CPU crc instructions-- :: [Note] InnoDB: Initializing buffer pool, size = 1.0G-- :: [Note] InnoDB: Completed initialization of buffer pool-- :: [Note] InnoDB: Highest supported file format is Barracuda.-- :: [Note] InnoDB: Log scan progressed past the checkpoint lsn -- :: [Note] InnoDB: Database was not shutdown normally!-- :: [Note] InnoDB: Starting crash recovery.-- :: [Note] InnoDB: Reading tablespace information from the .ibd files...-- :: [Note] InnoDB: Restoring possible half-written data pages -- :: [Note] InnoDB: from the doublewrite buffer...InnoDB: Doing recovery: scanned up to log sequence number -- :: [Note] InnoDB: Starting an apply batch of log records to the database...InnoDB: Progress in percent: InnoDB: Apply batch completedInnoDB: Last MySQL binlog file position 0 , file name mysql-bin.-- :: [Note] InnoDB: rollback segment(s) are active.-- :: [Note] InnoDB: Waiting for purge to start-- :: 7fa9edd InnoDB: Assertion failure in thread in file trx0purge.cc line InnoDB: Failing assertion: purge_sys->iter.trx_no <= purge_sys->rseg->last_trx_noInnoDB: We intentionally generate a memory trap.InnoDB: Submit a detailed bug report to 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: about forcing recovery.:: 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.
分析日志后发现,数据库无法重启的原因是因为ibdata1文件损坏,重启后无法正常恢复。
解决办法:
需要跳过恢复步骤,修改my.cnf文件,在my.cnf中的[mysqld]中添加:
innodb_force_recovery = 6innodb_purge_threads = 1
解释:
innodb_force_recovery可以设置为1-6,大的数字包含前面所有数字的影响。
具体数字对应的含义:
1-----(SRVFORCEIGNORECORRUPT):忽略检查到的corrupt页。2-----(SRVFORCENOBACKGROUND):阻止主线程的运行,如主线程需要执行full purge操作,会导致crash。3-----(SRVFORCENOTRXUNDO):不执行事务回滚操作。4-----(SRVFORCENOIBUFMERGE):不执行插入缓冲的合并操作。5-----(SRVFORCENOUNDOLOGSCAN):不查看重做日志,InnoDB存储引擎会将未提交的事务视为已提交。6-----(SRVFORCENOLOG_REDO):不执行前滚的操作。
再次启动mysql就ok了~
如果还无法启动,则需要删除数据目录datafile下的 ibdata1,ib_logfile*等文件。
启动后导出MySQL数据库,重新恢复即可。
以上这篇完美解决mysql启动后随即关闭的问题(ibdata1文件损坏导致)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持积木网。
关于mysql数据库误删除后的数据恢复操作说明 在日常运维工作中,对于mysql数据库的备份是至关重要的!数据库对于网站的重要性使得我们对mysql数据的管理不容有失!然后,是人总难免会犯错误,
Mysql数据库之主从分离实例代码 介绍MySQL数据库设置读写分离,可以使对数据库的写操作和读操作在不同服务器上执行,提高并发量和相应速度。现在的网站一般大点的,都采用有数据
mysql 找回误删表的数据方法(必看) 有备份的话很简单,只需要生成一个最近备份的数据然后用mysqlbinlog找回备份时间点之后的数据再恢复到现网即可。要是没有备份可能就会比较麻烦,找
标签: mysql 5.7启动
本文链接地址:https://www.jiuchutong.com/biancheng/349903.html 转载请保留说明!友情链接: 武汉网站建设