MySQL 5.7 複製的過濾引數
1、庫級過濾引數
--binlog-do-db=db_name Master節點記錄二進位制日誌的庫
--binlog-ignore-db=db_name Master節點不記錄二進位制日誌的庫
--replicate-do-db=db_name Slave節點應用日誌的庫
--replicate-ignore-db=db_name Slave節點不應用日誌的庫
2、表級過濾引數
--replicate-do-table=db_name.tbl_name Slave節點執行指定表的修改事件
--replicate-wild-do-table=db_name.tbl_name Slave節點執行正則中含有指定表的修改事件
--replicate-ignore-table=db_name.tbl_name Slave節點不執行指定表的修改事件
--replicate-wild-ignore-table=db_name.tbl_name Slave節點不執行正則中含有指定表的修改事件
MySQL裡面有啟動引數、系統引數,啟動引數透過show variables無法查詢到,可以在mysqld的選項中查到
例如關於二進位制日誌有Startup Options Used with Binary Logging、System Variables Used with Binary Logging兩種引數
上面所說的複製過濾引數均為啟動引數
設定引數
[root@localhost log]# mysqld --verbose --help > 02.txt
[root@localhost log]# vim 02.txt
..
--binlog-do-db=name Tells the master it should log updates for the specified
database, and exclude all others not explicitly
mentioned.
..
--binlog-ignore-db=name
Tells the master that updates to the given database
should not be logged to the binary log.
..
--replicate-do-table=name
Tells the slave thread to restrict replication to the
specified table. To specify more than one table, use the
directive multiple times, once for each table. This will
work for cross-database updates, in contrast to
replicate-do-db.
[root@localhost log]# vim /etc/my.cnf
..
# log
server-id = 10000
log-bin = /log/binlog/mysql-bin
binlog_format = MIXED
binlog-do-db = test
啟動資料庫後,檢視引數
mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000009 | 120 | test | | |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.03 sec)
--binlog-do-db=db_name Master節點記錄二進位制日誌的庫
--binlog-ignore-db=db_name Master節點不記錄二進位制日誌的庫
--replicate-do-db=db_name Slave節點應用日誌的庫
--replicate-ignore-db=db_name Slave節點不應用日誌的庫
2、表級過濾引數
--replicate-do-table=db_name.tbl_name Slave節點執行指定表的修改事件
--replicate-wild-do-table=db_name.tbl_name Slave節點執行正則中含有指定表的修改事件
--replicate-ignore-table=db_name.tbl_name Slave節點不執行指定表的修改事件
--replicate-wild-ignore-table=db_name.tbl_name Slave節點不執行正則中含有指定表的修改事件
MySQL裡面有啟動引數、系統引數,啟動引數透過show variables無法查詢到,可以在mysqld的選項中查到
例如關於二進位制日誌有Startup Options Used with Binary Logging、System Variables Used with Binary Logging兩種引數
上面所說的複製過濾引數均為啟動引數
設定引數
[root@localhost log]# mysqld --verbose --help > 02.txt
[root@localhost log]# vim 02.txt
..
--binlog-do-db=name Tells the master it should log updates for the specified
database, and exclude all others not explicitly
mentioned.
..
--binlog-ignore-db=name
Tells the master that updates to the given database
should not be logged to the binary log.
..
--replicate-do-table=name
Tells the slave thread to restrict replication to the
specified table. To specify more than one table, use the
directive multiple times, once for each table. This will
work for cross-database updates, in contrast to
replicate-do-db.
[root@localhost log]# vim /etc/my.cnf
..
# log
server-id = 10000
log-bin = /log/binlog/mysql-bin
binlog_format = MIXED
binlog-do-db = test
啟動資料庫後,檢視引數
mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000009 | 120 | test | | |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.03 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2091370/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL主從複製_複製過濾MySql
- mysql過濾複製的實現MySql
- MySQL搭建帶過濾的複製環境MySql
- MySQL 5.7並行複製MySql並行
- mysql 5.7半同步複製MySql
- mysql 5.7多源複製MySql
- MySQL 5.7 並行複製MySql並行
- [Mysql]Mysql5.7並行複製MySql並行
- 【Mysql】mysql5.7無損複製MySql
- 【Mysql】Mysql5.7的多源複製搭建MySql
- mysql5.7主從複製,主主複製MySql
- Mysql5.7半同步複製MySql
- MySQL 5.7搭建多源複製MySql
- MySQL 5.7 延遲複製配置MySql
- MySQL5.7主從複製-半同步複製搭建MySql
- MySQL5.7主從複製教程MySql
- mysql 5.7開啟並行複製MySql並行
- MySQL Case-MySQL5.7無效的並行複製MySql並行
- nuxt 過濾 query 引數UX
- mysql 5.7 主從複製搭建及原理MySql
- 【Mysql】mysql公開課之-mysql5.7複製特性MySql
- MySQL 5.7基於GTID的主從複製MySql
- MySQL 5.7組複製(group replication)的要求和限制MySql
- MySQL主從複製結構中常用引數MySql
- OGG -FILTER 引數過濾Filter
- MySQL 5.7線上設定忽略表複製方法MySql
- #MySQL# mysql5.7新特性之半同步複製MySql
- mysql 5.7 多主一從的多源複製搭建MySql
- 【MySQL】保證複製高可用的一些重要引數MySql
- MySQL 5.7資料庫引數優化MySql資料庫優化
- MySQL案例07:MySQL5.7併發複製隱式bugMySql
- MySQL 5.7 基於GTID搭建主從複製MySql
- MySQL5.7半同步複製報錯案例分析MySql
- MySQL 5.7 使用GTID方式搭建複製環境MySql
- http獲取get引數過濾HTTP
- OGG 行過濾filter 引數Filter
- MySQL 5.7的安裝及主從複製(主從同步)MySql主從同步
- MySQL主從複製配置引數 -- logs-slave-updatesMySql