千家信息网

通过replicate-wild-do-table解决replicate-do-db的一些问题

发表于:2024-11-18 作者:千家信息网编辑
千家信息网最后更新 2024年11月18日,--replicate-wild-do-table=db_name.tbl_nameCommand-Line Format--replicate-wild-do-table=namePermitted
千家信息网最后更新 2024年11月18日通过replicate-wild-do-table解决replicate-do-db的一些问题
  • --replicate-wild-do-table=db_name.tbl_name

    Command-Line Format--replicate-wild-do-table=name
    Permitted ValuesTypestring

    Creates a replication filter by telling the slave thread to restrict replication to statements where any of the updated tables match the specified database and table name patterns. Patterns can contain the "%" and "_" wildcard characters, which have the same meaning as for the LIKE pattern-matching operator. To specify more than one table, use this option multiple times, once for each table. This works for cross-database updates.

    通过告诉从线程创建一个复制筛选器来约束任何与指定的数据库和表名称相匹配的更新表相关的语句。模式可以包含"%"和"_"通配符,它与模式匹配算法类似。要指定多个表,使用此选项多次,每个表一次。这是跨数据库更新的工作。

    跨数据库这一点是重点,不像replicate-do-db那样,其他的库操作,就不会同步设定的库。这个参数,只要涉及到的该表,就会同步。


  • --replicate-wild-ignore-table=db_name.tbl_name

    Command-Line Format--replicate-wild-ignore-table=name
    Permitted ValuesTypestring

    Creates a replication filter which keeps the slave thread from replicating a statement in which any table matches the given wildcard pattern. To specify more than one table to ignore, use this option multiple times, once for each table. This works for cross-database updates.

0