Replication and Binary Logging Options and Variables If any binary logs from MySQL 5.7.7 or older are present on the server (for example, following an upgrade of an older server to MySQL 8.0), with  binlog_gtid_simple_recovery=TRUE , gtid_executed  and  gtid_purged  might be initialized incorrectly in the following two situations: If an incorrect GTID set is computed in either situation, it remains incorrect even if the server is later restarted with  binlog_gtid_simple_recovery=FALSE . If either of these situations apply or might apply on the server, set  binlog_gtid_simple_recovery=FALSE  before starting or restarting the server. When  binlog_gtid_simple_recovery=FALSE  is set, the method of computing  gtid_executed and  gtid_purged  as described in The  gtid_purged  System Variable is changed to iterate the binary log files as follows: Depending on the value of this variable, the server enforces GTID consistency by allowing execution of only statements that can be safely logged using a GTID. You  must  set this variable to  ON  before enabling GTID based replication. •The newest binary log was generated by MySQL 5.7.5 or earlier, and  gtid_mode  was  ON  for some binary logs but  OFF  for the newest binary log. •A  SET @@GLOBAL.gtid_purged  statement was issued on MySQL 5.7.7 or earlier, and the binary log that was active at the time of the  SET @@GLOBAL.gtid_purged  statement has not yet been purged. •Instead of using the value of  Previous_gtids_log_event  and GTID log events from the newest binary log file, the computation for  gtid_executed  iterates from the newest binary log file, and uses the value of  Previous_gtids_log_event  and any GTID log events from the first binary log file where it finds a  Previous_gtids_log_event  value. If the server’s most recent binary log files do not have GTID log events, for example if  gtid_mode=ON  was used but the server was later changed to  gtid_mode=OFF , this process can take a long time. •Instead of using the value of  Previous_gtids_log_event  from the oldest binary log file, the computation for  gtid_purged  iterates from the oldest binary log file, and uses the value of  Previous_gtids_log_event  from the first binary log file where it finds either a nonempty Previous_gtids_log_event  value, or at least one GTID log event (indicating that the use of GTIDs starts at that point). If the server’s older binary log files do not have GTID log events, for example if  gtid_mode=ON  was only set recently on the server, this process can take a long time. • enforce_gtid_consistency Command-Line Format --enforce-gtid-consistency[=value] System Variable enforce_gtid_consistency Scope Global Dynamic Yes SET_VAR  Hint Applies No Type Enumeration Default Value OFF Valid Values OFF ON WARN 3571