The value of @@GLOBAL.GTID_MODE can only be changed one step at a time: OFF <-> OFF_PERMISSIVE <-> ON_PERMISSIVE <-> ON. Also note that this value must be stepped up or down simultaneously on all servers. See the Manual for instructions.
SET @@GLOBAL.GTID_MODE = ON is not allowed because ENFORCE_GTID_CONSISTENCY is not ON.
二、设置gtid步骤
GTID_MODE 参数的值只能按照一步一步的顺序进行更改,即从 OFF 到 OFF_PERMISSIVE,再到 ON_PERMISSIVE,最后到达 ON。这意味着不能直接从 OFF 切换到 ON,也不能直接从 ON 切换到 OFF。