Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

How to do it...

  1. Stop the slave:
mysql> STOP SLAVE;Query OK, 0 rows affected (0.06 sec)
  1. 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)
  1. 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other