Bug #6542 create database and replication and replicate-do-table
Submitted: 10 Nov 2004 10:04 Modified: 11 Feb 2005 16:04
Reporter: Sergey Frolovichev Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0.22 and all lower OS:
Assigned to: Lars Thalmann CPU Architecture:Any

[10 Nov 2004 10:04] Sergey Frolovichev
I have a master and a lot of slave mysql servers all slaves uses replicate-do-table list. So If you'll write 'create database xx' on master it will be created on slave to, but as I understand with replicate-do-table this is not correct.

How to repeat:
Master & slave width replicate-do-table option. After this 'create database test_repltable'. You see this database on slave too.
[11 Feb 2005 16:04] Lars Thalmann
Thank you for your bug report.

This is not actually a bug.  The --replicate-do-table option only specifies 
what happens to statements involving tables.

We are thinking about changing the semantics of this.  But if we do,
it will most likely not be implemented until version 5.1.

There are two ways to get around this problem:

Either upgrade to 4.1.8 or later and restrict replication of CREATE
DATABASE statements by using --replicate-do-db or
--replicate-ignore-db (a bug was fixed in 4.1.8, so you need to
use at least this version).

Use the --replicate-wild-do-table=db_name.tbl_name option.
If you change your slave's options to: --replicate-wild-do-table=db1.%
a 'CREATE DATABASE db2' will not be replicated.