Stopping Replication on a MySQL Slave05 Apr 2011 | Comments
This is just a quick note to self as I needed to stop replication on one of the MySQL slaves today.
- Shut down master and slave
- Change slave’s my.cnf config file by adding skip-slave-status somewhere below the [mysqld] block
- Check if this works, by bring up the slave
- Connect to the server, and do show slave status\G
- If the replication has stopped the first line should just show Slave_IO_State: If it’s still replicating it will show: Slave_IO_State: Connecting to master
Above is the easiest way to stop replication. Alternatively you could also comment out the master-* lines on the slave’s my.cnf, but just be aware when you do this you’d also need to delete/rename master.info file. Master.info contains the “cached” information of the database master, the master-* values on my.cnf will be ignored when this file is found.