The server warns that enforce_gtid_consistency cannot be enabled because transactions that break GTID consistency are still running.
MySQL error 3117 ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS appears when you try to turn on enforce_gtid_consistency while non-GTID-safe transactions are active. Commit or roll back those transactions, then retry the SET statement to resolve the warning.
ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS
Error 3117 signals that MySQL cannot immediately switch the global enforce_gtid_consistency flag to ON because one or more open transactions perform operations that are not GTID-safe, such as creating or dropping temporary tables.
MySQL first issued this warning in version 5.7.6 and renamed it to ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX in MySQL 8.0. The SQLSTATE is HY000, indicating a general error.
The server checks all active sessions when you run SET GLOBAL enforce_gtid_consistency = ON. If any session holds a transaction that breaks GTID rules, MySQL emits error 3117 instead of applying the change. This prevents replication problems caused by unsafe statements.
GTID-consistent transactions are mandatory before enabling GLOBAL gtid_mode = ON. Failing to resolve error 3117 blocks the transition to GTID-based replication, delaying topology changes, failover automation, and point-in-time recovery workflows.
The most common cause is an application connection that began a transaction, executed a non-GTID-safe statement like CREATE TEMPORARY TABLE, and has not yet committed or rolled back.
Long-running administrative scripts, interactive sessions, or idle connections in autocommit = 0 may also leave transactions open for hours, triggering the warning when you attempt the configuration change.
First, locate sessions with ongoing GTID-violating transactions using Performance Schema or SHOW ENGINE INNODB STATUS. Commit or roll back each offending transaction, then reissue the SET statement.
If you cannot safely close a session, kill the connection to release the transaction. After all unsafe transactions disappear, MySQL allows enforce_gtid_consistency to be enabled.
An online schema change tool left a temporary table inside a transaction. Commit the tool's session or kill the process to clear the violation.
A data-loading script opened multiple sessions with autocommit disabled. Issue COMMIT on each connection or wait until the load completes before retrying.
Use autocommit for short statements and avoid temporary tables inside explicit transactions. Enforce a connection timeout policy that closes idle sessions automatically.
Enable SESSION enforce_gtid_consistency at application startup so developers catch unsafe statements early, long before you switch the GLOBAL setting.
Error 3170 ER_CANT_SET_GTID_MODE_WITH_GTID_TABLE_ENCRYPTION_ON occurs when encryption prevents GTID changes. Turn off encryption or upgrade.
Error 1840 ER_GTID_MODE_REQUIRED_PERMISSIVE mode appears if enforce_gtid_consistency is OFF when enabling GTID mode. Fix by enabling enforce_gtid_consistency first.
Temporary tables inside a transaction break GTID rules and block the configuration change.
Bulk operations that keep the transaction open hold unsafe statements in memory.
DBAs sometimes forget to commit after maintenance, leaving a violating transaction open.
Pooled connections may linger in an open transaction state due to coding errors.
Same condition but renamed from MySQL 8.0 onward.
Occurs when gtid_mode is changed without first enabling enforce_gtid_consistency.
Raised if other replication settings make gtid_mode change impossible.
No, replication continues but you cannot enable enforce_gtid_consistency until the warning is cleared.
Ignoring it leaves the server in a non-GTID-safe state and blocks future GTID replication changes.
A restart closes all sessions, so the warning disappears, but it causes downtime. Commit or kill sessions instead.
Galaxy highlights long-running transactions in its session panel, letting you commit or terminate them before applying GTID settings.