How to Fix MySQL Error 1788 (ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME)
You trigger mysql error 1788 when you skip stages while changing global transaction ID modes. You fix it by moving the setting one single step at a time. MySQL uses global transaction IDs to track changes across primary and replica servers. Each server has a mode that controls how it reads and writes these transaction IDs. The engine forces you to step through four distinct modes in a strict order. If an admin tries to jump from off straight to on, the database blocks the change. What causes
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 trigger mysql error 1788 when you skip stages while changing global transaction ID modes. You fix it by moving the setting one single step at a time.
MySQL uses global transaction IDs to track changes across primary and replica servers. Each server has a mode that controls how it reads and writes these transaction IDs. The engine forces you to step through four distinct modes in a strict order. If an admin tries to jump from off straight to on, the database blocks the change.
What causes mysql error 1788 in production
The database engine maps this failure to symbol ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME and SQLSTATE HY000. The official message states that the global mode can only change one step at a time. The valid path moves between OFF, OFF_PERMISSIVE, ON_PERMISSIVE, and ON.
This rule protects replication health across your database cluster. In OFF mode, the server only uses binary log file positions for transactions. In ON mode, the server demands a global ID for every single transaction. If one node jumps straight to ON, other nodes still send nameless transactions. Replication breaks right away when a strict replica reads an old transaction format.
The two permissive modes act as safe middle steps for live clusters. OFF_PERMISSIVE creates old transactions, but it accepts both old and new ones from peers. ON_PERMISSIVE creates new transactions with IDs, while still accepting old ones from peers. Stepping through each stage lets all servers adapt without dropping live traffic.
How to diagnose and fix the failure in production
First, check the current mode on your primary server and all replicas. Do not grant full superuser roles to basic maintenance accounts during this check. Use a narrow read role to inspect the current global status variables across the cluster.
Next, move every server in the cluster to the very next adjacent step. If your cluster sits at OFF, update every node to OFF_PERMISSIVE first. Wait until all nodes share this exact same setting before moving forward.
Mean Time to Detect (MTTD) + MySQL Access Governance: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
After all nodes run in OFF_PERMISSIVE, advance every server to ON_PERMISSIVE. In this stage, new writes start getting global transaction IDs across the whole fleet. Before taking the final step to ON, check the status of ongoing anonymous transactions. Wait until the binary logs process all remaining old transactions on every replica. Once zero old transactions remain in flight, move every node to the final ON state.
When turning the feature off, follow the exact same path in reverse. Step from ON to ON_PERMISSIVE, then to OFF_PERMISSIVE, and finally to OFF. Also update your server startup files so a restart does not revert the mode.
How to prevent configuration mistakes during maintenance
Most teams hit this error during manual maintenance or flawed automation runs. When an engineer runs ad-hoc admin commands in production, small mistakes cause outages. A script might try to set the final state without checking the current state first.
Treat global variable changes with strict peer review and least privilege controls. Lock down direct admin logins so engineers cannot run unchecked global changes at will. Require team approval before anyone alters replication modes on a live cluster. Keep a full audit log of every command and add data masking for emails or card numbers.
Add wire guardrails and masking beside MySQL
Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev sits inline in the wire protocol beside the database as a sidecar for your MySQL. On every production query an agent or engineer sends, hoop.dev decides to pass, mask, block, or escalate it for human review.
With hoop.dev MySQL support, guardrails refuse bad queries before they run or hold risky calls for approval, while data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.
Frequently asked questions
Can I skip permissive modes if I stop the database first?
No, the online command always enforces single steps while the server runs. Even during planned downtime, stepping through each mode prevents replication drift across your cluster.
In what order should I update primaries and replicas?
Move all servers in the cluster to the same step before advancing again. Keeping every node on the same permissive step stops replication errors from halting traffic.
How do I know when it is safe to move from ON_PERMISSIVE to ON?
Check the server status variables to verify that zero anonymous transactions remain active. Also confirm that all replicas have processed every older binary log event before switching.
Related guides
In this post