Sure. Set binlog-do-db to "foo" and set up a slave, and then try this:
create database foo; create database bar; use bar; create table foo.table1(a int); use foo; insert into table1(a) values(1); Now go to the slave and check replication. It's broken: Last_Error: Error 'Table 'foo.table1' doesn't exist' on query. Default database: 'foo'. Query: 'insert into table1(a) values(1)' Why? Because binlog-do-db doesn't do what you think it does. Check the docs again :) Read this: http://dev.mysql.com/doc/refman/5.0/en/replication-rules.html and then this: http://dev.mysql.com/doc/refman/5.0/en/replication-options-binary-log.html#option_mysqld_binlog-do-db I won't duplicate the documents here. The docs are clear and comprehensive. But pay attention to "default database" which is what changes when you say "use foo" or "use bar". Notice what the default database is in the error above! On Fri, Mar 6, 2009 at 12:08 PM, Atle Veka <at...@flyingcroc.net> wrote: > Hi, care to elaborate on the pit-falls of binlog-do-db? > > > Thanks, > Atle > > On Wed, 4 Mar 2009, Baron Schwartz wrote: > >> No. But I would recommend removing binlog-do-db and using >> replicate-wild-do-table=<mydb>.% on the slave instead. The >> binlog-do-db approach has many pitfalls anyway, and is likely to burn >> you at some point, e.g. get the slave out of sync with the master. >> The bonus of my suggestion is that you'll be able to see from SHOW >> SLAVE STATUS what's being replicated. >> >> -- >> Baron Schwartz, Director of Consulting, Percona Inc. >> Our Blog: http://www.mysqlperformanceblog.com/ >> Our Services: http://www.percona.com/services.html >> >> > -- Baron Schwartz, Director of Consulting, Percona Inc. Our Blog: http://www.mysqlperformanceblog.com/ Our Services: http://www.percona.com/services.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org