Mysql 无法启动,mysql-bin.日志丢失删除处理

在linux操作系统中,当mysql无法启动时候,先看日志

2024-03-15T05:20:16.352075Z 0 [Warning] [MY-000081] [Server] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824.
2024-03-15T05:20:16.352156Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2024-03-15T05:20:16.352249Z 0 [System] [MY-010116] [Server] /www/server/mysql/bin/mysqld (mysqld 8.0.20) starting as process 7470
2024-03-15T05:20:16.368878Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-03-15T05:20:17.909276Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-03-15T05:20:18.559824Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/tmp/mysqlx.sock' bind-address: '::' port: 33060
mysqld: File './mysql-bin.000002' not found (OS errno 2 - No such file or directory)
2024-03-15T05:20:18.646061Z 0 [ERROR] [MY-010958] [Server] Could not open log file.
2024-03-15T05:20:18.646234Z 0 [ERROR] [MY-010041] [Server] Can't init tc log

有一行很关键

mysqld: File './mysql-bin.000002' not found (OS errno 2 - No such file or directory)

找不到 日志文件

解决很简单,就是删除“binlog.index”文件,这样MySQL将默认重建“binlog.000001”二进制日志文件,MySQL服务正常启动!

如果是高版本

是这个文件

mysql-bin.index

安全提醒

如果不确定,首次操作必须要备份文件,例如重命名文件备份法“mysql-bin-临时作废.index”

这个文件在哪里呢?

文件路径

日志文件和数据库在一起

宝塔路径:/www/server/data

默认路径:

/var/lib/mysql/

相关推荐

  1. mysql服务器无法启动问题处理

    2024-03-22 20:14:03       13 阅读
  2. MySQL bin-log日志恢复数据

    2024-03-22 20:14:03       9 阅读
  3. mysql日志( Redo Log 、Undo Log、Bin Log)

    2024-03-22 20:14:03       19 阅读
  4. MySQL日志——redo log和bin log的刷盘时机详解

    2024-03-22 20:14:03       18 阅读
  5. mysql如何处理无效数据

    2024-03-22 20:14:03       8 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-22 20:14:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-22 20:14:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-22 20:14:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-22 20:14:03       20 阅读

热门阅读

  1. MacOS - GCC 版本升级解决方案

    2024-03-22 20:14:03       21 阅读
  2. 蓝桥杯考试注意事项

    2024-03-22 20:14:03       24 阅读
  3. HarmonyOS状态管理:@State与@Prop、@Link的示例

    2024-03-22 20:14:03       16 阅读
  4. docker基础(七)之docker start/stop/kill/restart/pause/unpause

    2024-03-22 20:14:03       19 阅读
  5. GC垃圾回收的算法

    2024-03-22 20:14:03       20 阅读
  6. 面试宝典:MySQL 主从同步深度解析

    2024-03-22 20:14:03       20 阅读
  7. Git 常用命令总结

    2024-03-22 20:14:03       17 阅读
  8. Appium官方文档常用方法介绍

    2024-03-22 20:14:03       20 阅读
  9. C++ 虚函数和多态

    2024-03-22 20:14:03       19 阅读
  10. MPI4.1文档3-MPI过程与MPI数据类型

    2024-03-22 20:14:03       16 阅读