Friday, May 15, 2020

ERROR 1840 (HY000): GTID_PURGED can only be set when GTID_EXECUTED is empty



mysql>stop slave;
mysql> reset master;
mysql > show global variables like '%GTID_EXECUTED%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| gtid_executed |       |
+---------------+-------+
mysql > show global variables like '%GTID_PURGED%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| gtid_purged |       |
+---------------+-------+
mysql > set global GTID_PURGED="9a511b7b-7059-11e2-9a24-08002762b8af:1-14";

mysql> show global variables like 'gtid_executed';
+---------------+-------------------------------------------------+
| Variable_name | Value                                           |
+---------------+-------------------------------------------------+
| gtid_executed | 16a931e0-b829-11e9-b423-0cc47ab45dc4:1-46251417 |
+---------------+-------------------------------------------------+
1 row in set (0.01 sec)

mysql> show global variables like 'gtid_purged';
+---------------+-------------------------------------------------+
| Variable_name | Value                                           |
+---------------+-------------------------------------------------+
| gtid_purged   | 16a931e0-b829-11e9-b423-0cc47ab45dc4:1-46102650 |
+---------------+-------------------------------------------------+
1 row in set (0.01 sec)

mysql> start slave io_thread;
mysql> show slave status\G

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: x.x.x.x
                  Master_User: user_name
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000248
          Read_Master_Log_Pos: 713228337
               Relay_Log_File: mysql-relay-bin.000004
                Relay_Log_Pos: 713215869
        Relay_Master_Log_File: mysql-bin.000248
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table: mamcdb_cloud.mamdatalist
      Replicate_Wild_Do_Table: mamcdb_cloud.%,aom.%,mediaxdb.%
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 713228337
              Relay_Log_Space: 713216076
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: 16a931e0-b829-11e9-b423-0cc47ab45dc4
             Master_Info_File: /var/lib/mysql/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set: 16a931e0-b829-11e9-b423-0cc47ab45dc4:46102667-46252600
            Executed_Gtid_Set: 16a931e0-b829-11e9-b423-0cc47ab45dc4:1-46252600
                Auto_Position: 1
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
1 row in set (0.00 sec)

No comments:

Post a Comment

HOW TO TO CALCULATE TABLE SIZE IN MB AND CREATE EXCEL SHEET IN MYSQL 5.7 USING CENTOS 7

 HOW TO TO CALCULATE TABLE SIZE IN MB AND CREATE EXCEL SHEET IN MYSQL 5.7 USING CENTOS 7 1.Given command below:- SELECT       table_schema a...