Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

3 Answers

up vote 1 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 master.info 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
add comment

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 master.info 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 master.info is found on my system –  user12145 Feb 10 '11 at 3:05
    
Can a "master.info" 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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.