I have mysql8 DB in my Linux server. I want to setup Replica for this DB. In this DB I have multiple schemas, But I want to setup a replica for only one schema.
Is it possible to set up a replica for one schema?
If it is possible what is the process to setup.
Please anyone help regarding this issue.
Thanks in Advance.
2
Answers
The version of mysql 8 can be referred to as follows:
change replication FILTER Replicate_Do_TabIe = (testdb) for channel ‘testdbchannel’;
Mysql 5.7 does not support FILTER.
In MySQL 8,
We can apply below filters:
REPLICATE_DO_DB: Include updates based on database name. Equivalent to –replicate-do-db.
REPLICATE_IGNORE_DB: Exclude updates based on database name. Equivalent to –replicate-ignore-db.
REPLICATE_DO_TABLE: Include updates based on table name. Equivalent to –replicate-do-table.
REPLICATE_IGNORE_TABLE: Exclude updates based on table name. Equivalent to –replicate-ignore-table.
REPLICATE_WILD_DO_TABLE: Include updates based on wildcard pattern matching table name. Equivalent to –replicate-wild-do-table.
REPLICATE_WILD_IGNORE_TABLE: Exclude updates based on wildcard pattern matching table name. Equivalent to –replicate-wild-ignore-table.
REPLICATE_REWRITE_DB: Perform updates on replica after substituting new name on replica for specified database on source. Equivalent to –replicate-rewrite-db.
Example: