MySQL raises ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE when a user tries to INSERT, UPDATE, or DELETE rows in mysql.gtid_executed, an internal table that tracks executed GTIDs.
ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE warns that you attempted to change mysql.gtid_executed, a protected system table holding GTID history. Stop modifying the table directly and use standard transactional workflows or GTID utilities to correct the issue.
ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE
MySQL error 3129 appears when a session issues INSERT, UPDATE, DELETE, or TRUNCATE against the mysql.gtid_executed table. This table is maintained internally to record the Global Transaction Identifiers (GTIDs) of every committed transaction.
GTIDs are central to replication consistency. Any manual change can corrupt the GTID set, break replication, and cause data divergence. MySQL therefore blocks the operation and emits the ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE warning instead.
User code or maintenance scripts that run DML against mysql.gtid_executed trigger the warning. This often occurs when engineers explore system tables without understanding their role.
Another common cause is a mis-crafted migration script that tries to purge GTID rows to "reset" replication. Since 5.7.8, MySQL protects the table to prevent these unsafe operations.
Immediately stop modifying mysql.gtid_executed. Revert any code, cron job, or migration that runs DML against the table.
If you need to adjust GTID sets, use MySQL's built-in commands such as RESET MASTER, RESET SLAVE ALL, or mysqlbinlog with --exclude-gtids. Always perform these steps during maintenance windows.
Scenario: A DBA wants to reclaim space by purging GTIDs. Solution: Run PURGE BINARY LOGS and let MySQL update mysql.gtid_executed automatically.
Scenario: A failed replication cluster needs GTID realignment. Solution: Use START SLAVE UNTIL SQL_BEFORE_GTIDS or SET GTID_PURGED, not manual table edits.
Grant developers read-only access to mysql schema objects. Reserve SUPER and SYSTEM_VARIABLES_ADMIN for DBAs.
Automate replication maintenance with vetted tools like mysqlshell or orchestrator. Never hand-edit system tables.
Error 1840 (ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF) occurs when you run SET GTID_PURGED with GTID_MODE disabled. Enable GTID_MODE before issuing the command.
Error 1782 (ER_MASTER_INFO) surfaces if replication metadata tables are corrupted. Recreate the slave with CHANGE MASTER TO and START SLAVE.
Developers exploring internal schemas may test DML statements on mysql.gtid_executed, triggering the warning.
Scripts that manually delete GTID rows to "reset" replication state raise error 3129.
Outdated backup or migration utilities might still attempt direct writes to mysql.gtid_executed.
Occurs when trying to purge GTIDs while GTID mode is disabled.
Indicates corrupted replication metadata tables.
Happens if SET GTID_PURGED is reissued with a different value.
No. Always use official MySQL commands to adjust GTIDs. Direct DML risks replication corruption.
MySQL emits a warning, but the DML is ignored. Your session should treat it as a failure and exit.
Execute RESET MASTER on the primary or use SET GTID_PURGED during logical export/import processes.
Galaxy's AI copilot flags DML against system tables in real time and suggests safer built-in commands, preventing accidental GTID corruption.