久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

MySQL 5.7 復(fù)制的過濾參數(shù)有哪些

137次閱讀
沒有評論

共計 1809 個字符,預(yù)計需要花費 5 分鐘才能閱讀完成。

這篇文章將為大家詳細(xì)講解有關(guān) MySQL 5.7 復(fù)制的過濾參數(shù)有哪些,文章內(nèi)容質(zhì)量較高,因此丸趣 TV 小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關(guān)知識有一定的了解。

1、庫級過濾參數(shù)

–binlog-do-db=db_name Master 節(jié)點記錄二進制日志的庫

–binlog-ignore-db=db_name Master 節(jié)點不記錄二進制日志的庫

–replicate-do-db=db_name Slave 節(jié)點應(yīng)用日志的庫

–replicate-ignore-db=db_name Slave 節(jié)點不應(yīng)用日志的庫

2、表級過濾參數(shù)

–replicate-do-table=db_name.tbl_name Slave 節(jié)點執(zhí)行指定表的修改事件

–replicate-wild-do-table=db_name.tbl_name Slave 節(jié)點執(zhí)行正則中含有指定表的修改事件

–replicate-ignore-table=db_name.tbl_name Slave 節(jié)點不執(zhí)行指定表的修改事件

–replicate-wild-ignore-table=db_name.tbl_name Slave 節(jié)點不執(zhí)行正則中含有指定表的修改事件

MySQL 里面有啟動參數(shù)、系統(tǒng)參數(shù),啟動參數(shù)通過 show variables 無法查詢到,可以在 mysqld 的選項中查到
例如關(guān)于二進制日志有 Startup Options Used with Binary Logging、System Variables Used with Binary Logging 兩種參數(shù)
上面所說的復(fù)制過濾參數(shù)均為啟動參數(shù)

設(shè)置參數(shù)
[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

啟動數(shù)據(jù)庫后,查看參數(shù)
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)

關(guān)于 MySQL 5.7 復(fù)制的過濾參數(shù)有哪些就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-07-19發(fā)表,共計1809字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 张家口市| 广平县| 兴宁市| 烟台市| 泽库县| 新丰县| 丁青县| 威信县| 宁远县| 通海县| 滁州市| 乃东县| 满城县| 河池市| 惠水县| 那坡县| 沙坪坝区| 准格尔旗| 石嘴山市| 聊城市| 嘉义县| 井冈山市| 尼木县| 博野县| 乐都县| 东乌珠穆沁旗| 嘉祥县| 威海市| 大安市| 江都市| 辽宁省| 江城| 兰州市| 昌江| 德令哈市| 武强县| 于田县| 宁德市| 乌拉特后旗| 陆河县| 娱乐|