Resolving MySQL binlog.index Missing Error After XtraBackup Restore on CentOS 8
This article describes a step‑by‑step investigation of a MySQL 8.0.18 startup failure caused by a missing binlog index file after using Percona XtraBackup on CentOS 8, analyzes the root cause, and provides practical fixes and diagnostic techniques such as strace and source‑code inspection.
1. Environment
The test was performed on a CentOS 8 (x86) server running MySQL 8.0.18 with Percona XtraBackup 8.0.10 as the backup tool.
Server OS
Database Version
Backup Tool
CentOS 8 for X86
MySQL 8.0.18
XtraBackup 8.0.10
2. Problem
After a successful backup‑restore cycle, MySQL failed to start with errors indicating that the binlog file name was missing:
2021-03-08T16:48:08.510032+08:00 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files.
2021-03-08T16:48:08.510125+08:00 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.18) starting as process 16556
mysqld: File '/var/lib/mysql/.000003' not found (OS errno 2 - No such file or directory)
2021-03-08T16:48:09.196673+08:00 0 [ERROR] [MY-010958] [Server] Could not open log file.
2021-03-08T16:48:09.196787+08:00 0 [ERROR] [MY-010041] [Server] Can't init tc log
2021-03-08T16:48:09.196961+08:00 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-08T16:48:10.632676+08:00 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.18) MySQL Community Server - GPL.The issue turned out to be a corrupted binlog.index file that lost the correct binlog name.
3. Test Procedure
The following steps were carried out to reproduce and diagnose the problem:
Create a MySQL 8.0.18 instance and take a full backup with XtraBackup.
Modify the log_bin setting in the new instance’s my.cnf to use a different binlog name, creating the mismatch.
Prepare the backup:
Copy‑back the data to the data directory:
Start MySQL and observe the same missing binlog error.
4. Analysis
Strace was used during the copy‑back phase to capture the system calls made by XtraBackup. The trace revealed that XtraBackup incorrectly rewrote binlog.index , dropping the original binlog filename and leaving a placeholder such as /var/lib/mysql/.000004 .
Further source‑code inspection (see the linked GitHub pull request) shows that the bug was fixed in newer XtraBackup releases (≥ 8.0.25‑17) by correcting the handling of absolute binlog paths.
5. Conclusions
(1) When MySQL fails to start after a backup restore with an error about a missing binlog file, the binlog.index file is often corrupted; rewriting it with the correct binlog name and restarting resolves the issue.
(2) Users of Percona XtraBackup versions from percona‑xtrabackup‑8.0.6 to percona‑xtrabackup‑8.0.23‑16 should be aware of this bug if the log_bin option contains an absolute path; upgrading to a version that includes the fix (e.g., 8.0.25‑17 ) is recommended.
6. References & Further Reading
Strace usage guide: One Question One Experiment – Table Cache
GDB debugging guide: One Question One Experiment – MySQL Crash Analysis
Compiling XtraBackup from source: Percona Documentation
Bug‑fix commit: GitHub
Linux open() man page: open(2)
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.