Common SQL Errors

MySQL Error 3113 ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION - How to Fix and Prevent

Galaxy Team
August 8, 2025

The replica refuses to apply an anonymous (non-GTID) transaction while GTID auto positioning is active.

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 3113 ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION?

MySQL error 3113 ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION occurs when a replica running AUTO_POSITION=1 receives a transaction that lacks a GTID. Convert all sources to GTID, disable AUTO_POSITION, or skip the event to restore replication.

Error Highlights

Typical Error Message

ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION

Error Type

Replication Configuration Error

Language

MySQL

Symbol

#ERROR!

Error Code

3113

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3113 ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION?

MySQL raises error 3113 when a replica configured with CHANGE MASTER AUTO_POSITION=1 encounters an anonymous transaction that lacks a Global Transaction Identifier. The replica halts to protect GTID consistency.

The issue appears in hybrid environments where some servers or logical imports still generate non-GTID events. Because the replica cannot map the anonymous event to a GTID sequence, it refuses to continue until you intervene.

What causes this error?

GTID replication requires every transaction to have a unique GTID. Anonymous events come from servers with gtid_mode disabled, backups produced without GTID metadata, or certain statements executed with GTID_NEXT set incorrectly.

Upgrades from versions prior to MySQL 5.6, mixed statement and row-based logging, or manual imports using mysqlbinlog without the set-gtid-purged option often trigger the problem.

How to fix MySQL error 3113

First confirm the stop point by running SHOW SLAVE STATUS. Then choose an approach: inject a fake GTID, convert the primary to GTID, or temporarily disable AUTO_POSITION.


-- Inject a placeholder GTID then resume
STOP SLAVE;
SET GTID_NEXT='00020321-1111-1111-1111-111111111111:1';
BEGIN; COMMIT;
SET GTID_NEXT='AUTOMATIC';
START SLAVE;

If you control the source, switch gtid_mode=ON and enforce_gtid_consistency=ON, take a fresh dump with --set-gtid-purged=ON, and rebuild the replica with AUTO_POSITION again.

Common scenarios and solutions

Logical dump without GTIDs - Re-export with mysqldump --set-gtid-purged=ON and restore on the replica.

Single legacy instance in a cluster - Enable GTIDs on that server, wait for all transactions to replicate, then turn AUTO_POSITION back on.

Best practices to avoid this error

Keep gtid_mode and enforce_gtid_consistency enabled on every server from installation forward. Always produce backups with GTID information preserved.

Monitor Last_IO_Error in SHOW SLAVE STATUS or via Galaxy alerts so replication stops are detected quickly and fixed before lag grows.

Related errors and solutions

Error 1236: Slave could not find binlog file - usually fixed by re-syncing the replica after ensuring the source retains logs.

Error 3102: ER_GTID_NEXT_TYPE_UNDEFINED_GROUP - indicates GTID_NEXT misuse; reset GTID_NEXT to AUTOMATIC after custom injection.

Common Causes

Primary server gtid_mode off

The source writes anonymous events because GTID support is disabled.

Backups restored without GTID metadata

mysqldump defaults to removing GTIDs unless --set-gtid-purged is specified.

Mixed binary logs in multi-version cluster

Older MySQL instances or MariaDB nodes may still emit anonymous events.

Manual session misconfiguration

Running SET GTID_NEXT to UUID with no subsequent automatic reset can create anonymous commits.

Related Errors

Error 1236 - Could not find first log file

Appears when binlog files have been purged on the source. Re-sync the replica.

Error 3102 - ER_GTID_NEXT_TYPE_UNDEFINED_GROUP

Raised when GTID_NEXT remains undefined after manual changes. Reset GTID_NEXT to AUTOMATIC.

Error 1872 - SLAVE_RELAY_LOG_READ_FAILURE

Indicates corrupted relay log files, often following forced skips. Recreate relay logs.

FAQs

Does skipping the event harm data integrity?

Skipping is safe only for noncritical data such as test inserts. Production data should be re-generated with a valid GTID.

Can I disable AUTO_POSITION permanently?

You can revert to file-based replication, but you lose GTID benefits like automatic failover. It is better to convert every server to GTID.

How do I know if all servers create GTIDs?

Query performance_schema by checking the variable gtid_mode on every node or run SELECT @@GLOBAL.gtid_mode.

How does Galaxy help here?

Galaxy highlights replication errors in real time, lets you share fix scripts with teammates, and keeps a versioned history of the change.

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