同步 - mysql5.7主从复制时如何忽略多张表
黄舟
黄舟 2017-04-17 16:13:14
0
2
821

mysql5.7中,主从同步复制时,貌似只能设置成忽略一张表.配置成多张表时,不起作用.

单表设置可以:

replicate-ignore-table = db.table1

多表设置不起作用:

replicate-ignore-table = db.table1 db.table2

或者是以分号隔开都不起作用

replicate-ignore-table = db.table1,db.table2
黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
大家讲道理
CHANGE REPLICATION FILTER filter[, filter][, ...]

filter:
    REPLICATE_DO_DB = (db_list)
  | REPLICATE_IGNORE_DB = (db_list)
  | REPLICATE_DO_TABLE = (tbl_list)
  | REPLICATE_IGNORE_TABLE = (tbl_list)
  | REPLICATE_WILD_DO_TABLE = (wild_tbl_list)
  | REPLICATE_WILD_IGNORE_TABLE = (wild_tbl_list)
  | REPLICATE_REWRITE_DB = (db_pair_list)

db_list:
    db_name[, db_name][, ...]

tbl_list:
    db_name.table_name[, db_table_name][, ...]
wild_tbl_list:
    'db_pattern.table_pattern'[, 'db_pattern.table_pattern'][, ...]

db_pair_list:
    (db_pair)[, (db_pair)][, ...]

db_pair:
    from_db, to_db

Example:

   CHANGE REPLICATION FILTER

   REPLICATE_WILD_IGNORE_TABLE = ('db1.new%', 'db2.new%');

Pay attention to the brackets.

大家讲道理

Look through the document link description

Use the following method in the configuration file to set multiple tables to ignore

replicate-ignore-table = db.table1
replicate-ignore-table = db.table2
replicate-ignore-table = db.table3
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template