we have a master-slave mysql replication setup. The master has multiple databases and they get created and dropped, fairly often. I would like to restrict the slave to not drop the databases. I couldn't find any such option on the mysql help page. We provide a Saas model erp application and maintain each customer in a different database. After the trial period expires we delete databases from the master regularly(after backing up of course). Only lost a disk once and lost a few of those databases.
You can prevent certain commands from being written to the binlog, and thus prevent them from being replicatd, by doing
SET sql_log_bin = 1
in the current session. See more at:
Make sure the connection you do this on is not used for other purposes (eg from within a connection pool), since no commands in it will be written do the binlog until you do
SET sql_log_bin = 0
or the connection is reestablished.
--read-only will not serve this purpose. It causes the slave to permit no updates except from slave threads or from users having the SUPER privilege. On a slave server, this can be useful to ensure that the slave accepts updates only from its master server and not from clients.