Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

MySQLdump to reset Slave server from Master

Posted by plattapuss on December 21st, 2006

Just a quick entry here. I keep forgetting how to reset a mysql slave server from the master, without disrupting the operations on the master server. Something silly that doesn't stick in my head, so I am putting here for future use:

If you have Server A with the master, and Server B with the slave, and you need to reset the slave if it gets lost, simply do this:

Login to the Server A and issue this command:

mysqldump --master-data --all-databases > newdbs.sql

Then scp or ftp the newdbs.sql file to Server B.

Login to Server B, stop http and turn off the slave (slave stop;), load in the new database SQL file you brought over and restart the mysql slave (slave start;) and http:

CODE:
  1. /etc/init.d/httpd stop
  2. mysql <newdbs.sql
  3. /etc/init.d/httpd start

To be sure everything is working as it should, you can go into mysql and 'show slave status;'



Reader Comments

Sorry, comments are closed.