- Stop the slave:
mysql> STOP SLAVE;Query OK, 0 rows affected (0.06 sec)
- Execute CHANGE MASTER TO MASTER_DELAY = and start the slave. Suppose you want a 1-hour delay, you can set MASTER_DELAY to 3600 seconds:
mysql> CHANGE MASTER TO MASTER_DELAY = 3600;Query OK, 0 rows affected (0.04 sec)mysql> START SLAVE;Query OK, 0 rows affected (0.00 sec)
- Check for the following in the slave status: SQL_Delay: Number of seconds by which the slave must lag the master. SQL_Remaining_Delay: Number of seconds left of the delay. This is NULL when there is delay is maintained. Slave_SQL_Running_State: The state of the SQL thread.
mysql> SHOW SLAVE STATUS\G*************************** 1. row *************************** Slave_IO_State: Waiting ...