标签:单位 for mys tab code master query 通过 cond
MySQL 5.7延迟复制是通过设置复制参数MASTER_DELAY实现(单位为秒,就是从库延迟多少秒后执行这条SQL)例如:
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.10.1.101
.....
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
......
Seconds_Behind_Master: 0
.....
SQL_Delay: 0
SQL_Remaining_Delay: 0
......
Channel_Name: master
Master_TLS_Version:
1 row in set (0.00 sec)
配置复制master延迟14400秒
mysql> stop slave;
Query OK, 0 rows affected (0.00 sec)
mysql> CHANGE MASTER TO MASTER_DELAY=14400 for channel ‘master‘;
Query OK, 0 rows affected (0.01 sec)`1q
mysql> start slave;
Query OK, 0 rows affected (0.01 sec)
查看结果
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Opening tables
Master_Host: 10.10.1.101
.....
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
.....
Seconds_Behind_Master: 12
.......
SQL_Delay: 14400
SQL_Remaining_Delay: 12
........
Channel_Name: master
Master_TLS_Version:
1 row in set (0.00 sec)
标签:单位 for mys tab code master query 通过 cond
原文地址:https://blog.51cto.com/mydbs/2436679