Common SQL Errors

MySQL Error 1888 ER_FOUND_MISSING_GTIDS: How to Fix Missing GTID Binary Logs in Replication

Galaxy Team
August 8, 2025

The replica cannot connect because the primary has already purged binary logs that contain GTIDs the replica still needs.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1888 ER_FOUND_MISSING_GTIDS?

MySQL error 1888 ER_FOUND_MISSING_GTIDS occurs when a replica requests GTIDs that the primary has already deleted from its binary logs. Re-seed the replica from a recent backup or transfer the missing logs, then raise binlog_expire_logs_seconds on the primary to prevent future purges.

Error Highlights

Typical Error Message

ER_FOUND_MISSING_GTIDS

Error Type

Replication Error

Language

MySQL

Symbol

the present server has purged required binary logs. The connecting server needs to replicate the missing transactions from elsewhere, or be replaced by a new server created from a more recent backup. To prevent this error in the future, consider increasing the binary log expiration period on the present server. %s. ER_FOUND_MISSING_GTIDS was added in 5.7.29.

Error Code

1888

SQL State

HY000

Explanation

Table of Contents

What is MySQL Error 1888 ER_FOUND_MISSING_GTIDS?

MySQL throws error 1888 ER_FOUND_MISSING_GTIDS when a replica connects to a source that no longer retains the binary logs containing the Global Transaction Identifiers (GTIDs) the replica requires. Replication halts immediately.

The problem is serious because GTID-based replication cannot skip or guess missing transactions. Until the replica receives every requested GTID, data divergence is possible and the channel stays stopped.

When does this error occur?

The error surfaces during CHANGE MASTER TO, START SLAVE, or automatic reconnections. It primarily affects GTID-enabled topologies on MySQL 5.7.29 and later, where binary log purge policies are aggressive.

Cloud environments that auto-purge logs and on-prem clusters with low binlog_expire_logs_seconds are most vulnerable, especially if replicas lag for hours or days.

Why is it important to fix quickly?

Replication outages delay downstream analytics, backups, and disaster-recovery strategies. The longer a replica remains stopped, the larger its data gap grows, increasing recovery time objectives (RTOs).

In HA setups using semi-sync or group replication, missing GTIDs can also block failover because candidates may lack required transactions.

Common Causes

Short binary log retention

binlog_expire_logs_seconds or expire_logs_days is set too low, causing the primary to purge logs still needed by slow replicas.

Replica lag

Resource-constrained replicas fall behind, leaving more time for the primary to delete the relevant binary logs.

Manual PURGE BINARY LOGS

DBAs may purge logs by filename or date without checking replica positions, destroying required GTIDs.

Disk full events

Disk pressure triggers emergency purges or script-based deletions of old logs, leading to gaps.

Related Errors

MySQL Error 1236

Could not find first log file name in binary log index - occurs with file-based replication when logs are missing.

MySQL Error 1189

Net error reading from master - network interruptions can lead to lag that later triggers error 1888.

MySQL Error 1201

Could not initialize master info structure - often follows file permission or missing file issues.

FAQs

Can I skip missing GTIDs to resume replication?

No. GTID replication requires every transaction. Skipping would corrupt data consistency.

Does increasing binlog retention impact performance?

Longer retention consumes disk but has negligible CPU or memory cost. Monitor disk space and rotate logs to archive storage if needed.

How can Galaxy help avoid error 1888?

Galaxy surfaces replica lag metrics and supports saved queries that alert when primary binary logs near expiration, letting teams act before purges.

Is error 1888 specific to MySQL 5.7?

The condition code was added in 5.7.29, but the underlying issue exists in 8.0 and MariaDB with similar messages.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo