lcpsky

导航

MySQL服务器断电无法启动处理过程

问题描述

2021-09-14 09:02:42 f24 InnoDB: Operating system error number 1117 in a file operation.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2021-09-14 09:02:42 4780 [ERROR] InnoDB: File .\ibdata1: ‘Windows aio’ returned OS error 1217. Cannot continue operation
2021-09-14 09:06:17 4540 [Note] Plugin ‘FEDERATED’ is disabled.
2021-09-14 09:06:17 4540 [Note] InnoDB: Using atomics to ref count buffer pool pages
2021-09-14 09:06:17 4540 [Note] InnoDB: The InnoDB memory heap is disabled
2021-09-14 09:06:17 4540 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-09-14 09:06:17 4540 [Note] InnoDB: Memory barrier is not used
2021-09-14 09:06:17 4540 [Note] InnoDB: Compressed tables use zlib 1.2.3
2021-09-14 09:06:17 4540 [Note] InnoDB: Not using CPU crc32 instructions
2021-09-14 09:06:17 4540 [Note] InnoDB: Initializing buffer pool, size = 321.0M
2021-09-14 09:06:17 4540 [Note] InnoDB: Completed initialization of buffer pool
2021-09-14 09:06:17 4540 [Note] InnoDB: Highest supported file format is Barracuda.
2021-09-14 09:06:17 4540 [Note] InnoDB: Log scan progressed past the checkpoint lsn 130230507620
2021-09-14 09:06:17 4540 [Note] InnoDB: Database was not shutdown normally!
2021-09-14 09:06:17 4540 [Note] InnoDB: Starting crash recovery.
2021-09-14 09:06:17 4540 [Note] InnoDB: Reading tablespace information from the .ibd files…
2021-09-14 09:06:17 4540 [Note] InnoDB: Restoring possible half-written data pages
2021-09-14 09:06:17 4540 [Note] InnoDB: from the doublewrite buffer…
2021-09-14 09:06:45 1728 InnoDB: Operating system error number 1117 in a file operation.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html

网上给出解决办法:

方案一

  1. 打开mysql安装目录的data文件夹,删除以下3个文件:ibdata1,ib_logfile0和ib_logfile1。
  2. 重新启动mysql。
  3. 可以重启,但是innodb表无法启动了。

方案二

  1. 在my.cnf中修改以下两个参数
    innodb_force_recovery=6
    innodb_purge_thread=0
  2. 重启MySQL ,立即对数据库做逻辑导出 ,完成之后将innodb_force_recovery设置为0 ,然后重建数据库 。

自己的偷懒版本

方案三

因为方案一不可用,方案二太麻烦。结合本次错误日志中标注黑体部分提示,可能是操作系统文件系统问题,先备份一下ibdata1,ib_logfile0和ib_logfile1。

  1. 检查磁盘坏块
    CHKDSK E:/R
  2. 重启MySQL服务
    竟然重启成功了!!!

posted on 2021-09-14 11:51  lcpsky  阅读(1039)  评论(0编辑  收藏  举报