Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used replication to migrate all data to a new server, and then I commented out master_host,master_port etc(basically all lines related to master) in my.cnf, I issued stop slave.
However I after restarted mysqld, the replication process is running again! how to stop it for good.

share|improve this question
up vote 2 down vote accepted

The proper way to do this is stop slave; reset slave;

The 'reset slave' is the part that will wipe the config and keep it from reconnecting.

share|improve this answer
is the config stored in the database? – user12145 Feb 10 '11 at 2:46
I'm not sure. I believe part of it is stored in as lynxman mentioned, but this command controls that file (at least thats what the doc says). Anyway I've used it and its worked for me. – Patrick Feb 10 '11 at 3:56

In order to completely stop replication you have two ways

  • Issue a 'CHANGE MASTER` command with fake info, that'll break the replication for good
  • Remove the file that sits on root of your mysql, that'll remove replication info

In any of those cases you'll need to redo your replication later, write down all the replication data like last position and last source-bin file just in case you want to start replication again.

share|improve this answer
no is found on my system – user12145 Feb 10 '11 at 3:05
Can a "" file be deleted safely from a running master-DB. I know it's supposed to be there on a slave, but it's a left-over from an import where "CHANGE MASTER" was set on the master... – Henk May 23 '11 at 15:11

I usually do an STOP SLAVE; CHANGE MASTER TO MASTER_HOST=''; to kill off a slave.

share|improve this answer
This no longer works. I get Incorrect arguments to MASTER_HOST on mysql 5.5.38 – Shoan Sep 4 '14 at 1:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.