简体   繁体   中英

Restoring mysql dump on a master

I have a master which is replicated by five slaves. I need to restore a database on the master and plan to do so with mysql db_name < db_name.dump. My question is do I need to stop mysql on the master before I do so for the slaves to automatically pick up the changes? If so what commands must I execute before doing mysql db_name < db_name.dump ?

Here's what happens:

  1. The master runs all the changes in the dump file (mostly CREATE TABLE and INSERT statements).
  2. The master logs all those changes in its binary log.
  3. Each replica downloads the binary log from the master.
  4. Each replica replays the same changes.

You don't need to stop anything. All the replicas will replicate the changes, as long as you have configured replication correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM