Replicating specific databases only
As mentioned earlier, the master and slave database server do not need to be entirely in sync, with all databases and all tables from the master replicated onto the slave. By default, the slave will replicate everything, but you can change this behavior with the following options in the slave configuration file:
replicate-do-db=db_name (replicate this database)
replicate-ignore-db=db_name (don't replicate this database)
replicate-do-table=db_name.table_name (replicate this table)
replicate-ignore-table=db_name.table_name (don't replicate this table)
replicate--wild-do-table=db_name.table_name
(allows wildcards, e.g db% would be all databases beginning with db)
replicate-wild-ignore-table=db_name.table_name (ignore all specified tables, with wildcards)
These options can all be used multiple times in a single configuration. A couple of other useful options:
replicate-rewrite-db=master_db->slave_db (allows you to use map databases
that use different database names on each server)
log-slave-update (writes replicated statements to the slaves binary logs)