Rumah > Soal Jawab > teks badan
mysql5.7中,主从同步复制时,貌似只能设置成忽略一张表.配置成多张表时,不起作用.
单表设置可以:
replicate-ignore-table = db.table1
多表设置不起作用:
replicate-ignore-table = db.table1 db.table2
或者是以分号隔开都不起作用
replicate-ignore-table = db.table1,db.table2
大家讲道理2017-04-17 16:15:14
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
举例:
CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE = ('db1.new%', 'db2.new%');
注意括号。
大家讲道理2017-04-17 16:15:14
翻了下文档链接描述
在配置文件中使用下面的方法实现了设置多张表忽略
replicate-ignore-table = db.table1
replicate-ignore-table = db.table2
replicate-ignore-table = db.table3