This post discusses how to use replication filters to ignore a table or a database in replication. MySQL both have replication filters that explicitly allows and excludes replication of a database or a table from replicating. In this case, you will need to use the filters that ignore. There are three replications filters that can be used to ignore one or more tables:
- replicate-ignore-db
- replicate-ignore-table
- replicate-wild-ignore-table
Each of these options will be discussed below. Shared for all of them are that they take exactly one argument, but you can specify the same option multiple times as needed.
replicate-ignore-db
In statements-based replication, replicate-ignore-db ignores statements having the default database as the database being ignored. In row-based replication, all tables in the specified database are ignored.
replicate-ignore-table
This option ignores the one table specified.
replicate-wild-ignore-table
This is the most flexible option. All tables matching the expression will be ignored. For example:
- replicate-wild-ignore-table = foo.% : ignores all tables in the foo database
- replicate-wild-ignore-table = foo.b% : ignores all tables in the foo database prefixed with b
- replicate-wild-ignore-table = foo%.bar% : does not replicate updates that use a table where the database name starts with foo and the table name starts with bar.