How to Fix MySQL Error 3129 (ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE)
You get mysql error 3129 when a query tries to change the internal GTID executed table. To fix this warning, stop direct edits to that system table and use built-in replication tools. Database servers use Global Transaction Identifiers, or GTIDs, to track every committed change across a cluster. The server stores these IDs inside a private system table inside its internal database. When a user or script edits that table by hand, the server raises SQLSTATE HY000. The official symbol for this ale
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get mysql error 3129 when a query tries to change the internal GTID executed table. To fix this warning, stop direct edits to that system table and use built-in replication tools.
Database servers use Global Transaction Identifiers, or GTIDs, to track every committed change across a cluster. The server stores these IDs inside a private system table inside its internal database. When a user or script edits that table by hand, the server raises SQLSTATE HY000. The official symbol for this alert is ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE. It warns you that direct changes can break data sync across your nodes.
Why mysql error 3129 happens in your database
The database engine manages the GTID executed table on its own during normal work. Every time a transaction finishes, the engine writes the new ID record into this internal space. It also compresses this table from time to time to save disk space. It expects to be the only writer touching those rows.
Several common actions trigger mysql error 3129 in a live system. First, an admin might try to skip a broken replication event by inserting a fake row. Second, a full database dump from another server might include internal system tables by mistake. When you import that backup file, the restore script tries to overwrite the protected GTID table. Third, a migration tool with broad root rights might attempt to clear old system logs.
Allowing these manual writes puts your whole cluster at risk. If the table holds bad data, replicas will ask for the wrong transaction sets. Some nodes might skip needed updates, while others might stop syncing right away. That is why the engine blocks or flags manual edits to this internal storage.
How to diagnose and fix the warning in production
Start by finding out which user or script ran the bad query. Check your database audit logs and slow query logs for recent writes to the internal schema. Look for restore jobs, custom sync scripts, or manual admin sessions that ran at that time.
If a backup restore caused the alert, change how your team takes database dumps. Set up your backup tool so it leaves out internal system tables during exports. Standard backup tools have a built-in setting to export GTID state through session variables instead. When you restore the file, the server updates its state through safe internal steps.
Single Sign-On (SSO) + MySQL Access Governance: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
If an admin triggered the warning while fixing a replication conflict, use the proper engine workflow. Never insert or delete rows in the GTID executed table to skip a failing transaction. Instead, stop the replica worker, commit an empty transaction with the target ID, and restart sync. The engine will record that ID in the right place without corrupting internal tracking tables.
How to prevent manual changes to internal system tables
Most system table errors happen because people and scripts run with full admin rights. When an app or engineer has superuser roles, nothing stops them from writing to internal schemas. You can prevent this by splitting daily database roles from high-level admin roles.
Give your apps and routine scripts permissions that only cover your business data schemas. Revoke write permissions on the internal system schema for all standard user accounts. For human engineers, require peer reviews before anyone runs state changes on production database nodes. You can also add query rules that block direct writes to internal system tables before execution.
Inspect every MySQL query and response in flight
Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.
First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.
Frequently asked questions
What does ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE mean?
This symbol means a user or script tried to edit the internal GTID tracking table directly. The database raises code 3129 to warn you that manual edits can break replication.
Can I delete rows from the GTID table to free up disk space?
No, you should never delete rows from this table by hand to save space. The database engine clears and compresses this table on its own during log rotation cycles.
How do I skip a broken transaction without triggering mysql error 3129?
Do not insert rows into the internal system table to skip a bad transaction. Instead, assign the failing transaction ID to your session, commit an empty transaction, and restart replication.
Related guides
In this post