1. 首先在mater主机查看当前进行到的GTID事务点,记录下来
     mysql> show master status\G
     *************************** 1. row ***************************
                  File: master01.000017
              Position: 35667862
          Binlog_Do_DB: afmweb_news,gw_local,umc_ah
      Binlog_Ignore_DB: afmtimer,afmweb_news_cg,umc_ah_cg,gearman,mysql,information_schema,performance_schema
     Executed_Gtid_Set: a9b9b63d-6b63-11e6-8f20-3440b5860519:1-34339
     1 row in set (0.02 sec)
    

    当前1-34339是进行到此刻的GTID事务点,然后锁表,禁止数据插入变化

     mysql> flush tables with read lock;         //锁表,防止主数据库更新
     mysql> SHOW VARIABLES LIKE 'event_scheduler';
     +-----------------+-------+
     | Variable_name   | Value |
     +-----------------+-------+
     | event_scheduler | ON    |
     +-----------------+-------+
     mysql> SET GLOBAL event_scheduler = off ;         //关闭事件调度器
    
  2. 从库进行数据恢复以后,跳过记录的GTID事务点之前的事务,开始从此事务点和主库同步
     mysql> stop slave; 
     Query OK, 0 rows affected (0.07 sec)      
     mysql> reset master; 
     Query OK, 0 rows affected (0.17 sec) 
     mysql> reset slave;  
     Query OK, 0 rows affected (0.16 sec) 
     mysql> set global gtid_purged='a9b9b63d-6b63-11e6-8f20-3440b5860519:1-34339';                                            
     Query OK, 0 rows affected (0.13 sec) 
     mysql> CHANGE MASTER TO MASTER_HOST='192.168.1.140',MASTER_USER='dbslave',MASTER_PASSWORD='yourpassword'
     ,MASTER_AUTO_POSITION = 1; 
     Query OK, 0 rows affected, 2 warnings (0.33 sec) 
     mysql> start slave; 
     Query OK, 0 rows affected (0.11 sec) 
    
  3. 主库解锁,开始同步
     mysql> unlock tables;                        //解锁
     mysql> SHOW VARIABLES LIKE 'event_scheduler';
     +-----------------+-------+
     | Variable_name   | Value |
     +-----------------+-------+
     | event_scheduler | OFF   |
     +-----------------+-------+
     mysql> SET GLOBAL event_scheduler = on ;         //开启事件调度器
    

11 条评论

evotaya · 2025-12-19 20:09

Heard about evotaya.net. Took a look, and it seems like it could be your thing, depending on what you’re after. Worth a quick browse I reckon. Here’s the link: evotaya

sv288com · 2025-12-24 10:50

Heard about sv288com.net. Might be your thing depending on what you’re looking for. Check it out here: sv288com

tayabet · 2026-01-14 17:21

tayabet https://www.yetayabet.net

taya333 · 2026-01-14 18:18

taya333 https://www.taya333.org

gkbet · 2026-01-14 19:44

gkbet https://www.gkbeth.org

jilivip · 2026-01-14 22:25

jilivip https://www.jilivipu.net

phtaya1 · 2026-01-15 00:23

phtaya1 https://www.phtaya1.org

pin77 app · 2026-01-15 01:53

pin77 app https://www.pin77.tech

999jilimakatireviews · 2026-01-31 14:07

Hey! Checked out 999jilimakatireviews, it’s a decent spot to get the lowdown. Good for finding honest opinions, you know? Worth a look! 999jilimakatireviews

phdream11login · 2026-01-31 14:07

Yo, anyone using phdream11login? Seems pretty slick for getting into the game. Easy peasy, right? phdream11login

13win40 · 2026-01-31 14:08

Heard some buzz about 13win40. Decent user experience for what it is and easy to navigate. 13win40

回复 gkbet 取消回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注