通過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. 

  • 發表評論
    所有評論
    還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
    相關文章