Mariadb Replication Question
Hi All,
Very quick question when you have a moment. I have a setup with 9 masters and one 1 slave. I've been asked to move a database from one of the master mariadb server to another, as the server is under performing.
My question is, if I backup the Mariadb database and then delete the database on the master Mariadb, will this delete it from the replica slave?
Kind Regards, John
Answer Answered by Kristian Nielsen in this comment.
Yes, by default a DROP DATABASE xxx on the master will be replicated to the slave and delete the database there as well.
One way to avoid this is to disable binlogging for the DROP DATABASE, so that it does not participate in the replication, using sql_log_bin:
<<code lang=mysql>>
SET STATEMENT sql_log_bin=0 FOR DROP DATABASE xxx;
<<code>>
It is best to test this first by creating an extra empty database and test that it can be dropped on the master without affecting the slave.