1772
MariaDBERRORNotableReplicationHIGH confidence

Cannot set gtid_purged when gtid_mode is OFF

Production Risk

Medium — GTID configuration error.

What this means

SET GLOBAL gtid_purged was attempted but GTID mode is disabled on the server.

Why it happens
  1. 1Attempting to set gtid_purged while gtid_mode=OFF.
How to reproduce
trigger — this will error
trigger — this will error
SET GLOBAL gtid_purged = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:1-100'; -- gtid_mode is OFF

expected output

ERROR 1772 (HY000): Cannot set variable 'gtid_purged' when GTID_MODE is OFF.

Fix

Enable GTID mode before setting gtid_purged

Enable GTID mode before setting gtid_purged
SET GLOBAL gtid_mode = 'OFF_PERMISSIVE';
SET GLOBAL gtid_mode = 'ON_PERMISSIVE';
SET GLOBAL gtid_mode = 'ON';
SET GLOBAL gtid_purged = 'xxxxxxxx:1-100';

Why this works

GTID mode must be ON before gtid_purged can be modified.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1772 ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors