It is good idea to turn of MySQL server at start. So that if the master goes down it does not start by itself when it comes back up.
Follow these steps on the slave :
Note: The Slave also has to be setup with binary logging enabled. In order to this you can add the following line to your my.cnf file :
log-bin = /var/lib/mysql/name-bin
Login to msyql
Show master status \G;
Note the binary log position and the name on the result. This will be needed on the slave.
On the Master :
Login to mysql
- CHANGE MASTER TO MASTER_HOST=’masterservername or ip’, MASTER_LOG_FILE=’binarylogname’, MASTER_LOG_POS=’binarylogposition from step 4 above’;
It is also good idea to clear the logfiles on slave.