1SET @start_global_value = @@global.gtid_owned; 2SELECT @start_global_value; 3@start_global_value 4 5select @@global.gtid_owned; 6@@global.gtid_owned 7 8select @@session.gtid_owned; 9@@session.gtid_owned 10 11show global variables like 'gtid_owned'; 12Variable_name Value 13gtid_owned 14show session variables like 'gtid_owned'; 15Variable_name Value 16gtid_owned 17select * from information_schema.global_variables where variable_name='gtid_owned'; 18VARIABLE_NAME VARIABLE_VALUE 19GTID_OWNED 20select * from information_schema.session_variables where variable_name='gtid_owned'; 21VARIABLE_NAME VARIABLE_VALUE 22GTID_OWNED 23set @@global.gtid_owned = 1; 24ERROR HY000: Variable 'gtid_owned' is a read only variable 25set @@session.gtid_owned = 1; 26ERROR HY000: Variable 'gtid_owned' is a read only variable 27set @@session.gtid_next = 'anonymous'; 28select @@session.gtid_owned; 29@@session.gtid_owned 30ANONYMOUS 31select @@global.gtid_owned; 32@@global.gtid_owned 33 34ROLLBACK; 35set @@session.gtid_next = 'automatic'; 36select @@session.gtid_owned; 37@@session.gtid_owned 38 39select @@global.gtid_owned; 40@@global.gtid_owned 41 42