How to Stop MySQL from Replicating CREATE TABLE on Slave for Ignored Databases

MySQLreplication

Mine is a simple MySQL Master-Slave setup, with --binlog-do-db option as discussed in this article.

As per the documentation, logs are written for DDL statements for all databases irrespective of '--binlog-do-db'.

Is there any way to stop this??

Best Answer

binlog_do_db = dbname says to replicate any statement when the default database is dbname. So be careful what USE statement precedes the statement:

USE non_repl_db;
CREATE TABLE ...;