Can MySQL replication master-slave be used for backup?
Posted on 2011-10-01
I've setup a mysql replication environment, master-slave (2) servers.
When something is written in the master it will replicate in the slave as suppose to.
My question is: 1) Can I use this setup for backup? Meaning, if the master database or a table gets corrupted, can I do a dump from the Slave and import into the Master server? Or in case the database get's hacked or someone deletes all or some tables, are there ways to restore it from the slave?
2) Or if the above is not possible, is there a way to setup a third server maybe (slave) to just do live backup and if something database/table gets deleted it wouldn't change on the backup server. Or maybe set it up to sync every 1-2 hours?
Or everything that happens with the Master will happen as well to the Slave, being good or bad?
I'm trying to not use mysqldump and hot copies of /var/lib/mysql
Please clarify it for me.
Thank you very much!