标签:
数据库
Mysql 数据库
本文档使用 MrDoc 发布
-
+
首页
Mysql 数据库
> 记录一次服务器断电异常重启后,数据库服务无法启动,数据库损坏,通过binlog文件恢复数据的步骤 ------------ - ## 数据库服务无法启动 ### 启动服务报错信息 ```bash systemd[1]: Starting LSB: start and stop MariaDB... mysqld[8059]: 230704 09:40:27 mysqld_safe Starting mariadbd daemon with databases from /www/server/data mysqld[8059]: /etc/rc.d/init.d/mysqld: line 263: kill: (8190) - No such process mysqld[8059]: ERROR! systemd[1]: mysqld.service: control process exited, code=exited status=1 systemd[1]: Failed to start LSB: start and stop MariaDB. systemd[1]: Unit mysqld.service entered failed state. systemd[1]: mysqld.service failed. ``` ### 日志报错信息 ````bash 230704 10:56:30 mysqld_safe Starting mariadbd daemon with databases from /www/server/data 2023-07-04 10:56:30 0 [Warning] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824 2023-07-04 10:56:30 0 [Note] /www/server/mysql/bin/mariadbd (server 10.7.3-MariaDB-log) starting as process 10336 ... 2023-07-04 10:56:30 0 [Note] InnoDB: Compressed tables use zlib 1.2.7 2023-07-04 10:56:30 0 [Note] InnoDB: Number of transaction pools: 1 2023-07-04 10:56:30 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions 2023-07-04 10:56:30 0 [Note] InnoDB: Using Linux native AIO 2023-07-04 10:56:30 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728 2023-07-04 10:56:30 0 [Note] InnoDB: Completed initialization of buffer pool 2023-07-04 10:56:30 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=42397,42397 2023-07-04 10:56:30 0 [ERROR] InnoDB: Missing FILE_CHECKPOINT at 42397 between the checkpoint 42397 and the end 45976651. 2023-07-04 10:56:30 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2023-07-04 10:56:30 0 [Note] InnoDB: Starting shutdown... 2023-07-04 10:56:31 0 [ERROR] Plugin 'InnoDB' init function returned error. 2023-07-04 10:56:31 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2023-07-04 10:56:31 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-07-04 10:56:31 0 [ERROR] Unknown/unsupported storage engine: InnoDB 2023-07-04 10:56:31 0 [ERROR] Aborting ```` ### 解决方法 自行查找 `ib_logfile0` 文件所在目录,并删除 ```bash ib_logfile0文件是InnoDB存储引擎使用的一个重要文件,它用于记录数据库的事务日志。如果该文件出现问题,可能会导致MariaDB启动失败或出现错误。 ``` - ## 数据库数据损坏 > 通过binlog文件 ### 转化为sql文件 ```bash mysqlbinlog 文件名称 -d 数据库名称> filename_binlog.sql ``` ### 登录数据库执行 ```bash source filename_binlog.sql ``` 以上,实施过程中可能有不同的报错提示,具体情况具体解决即可。 参考文章:https://juejin.cn/post/7090789934453227527
mysql
数据库
admin
Linux
2024年6月27日 13:40
转发
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
下载Markdown文件
分享
链接
类型
密码
更新密码