Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the filter parameters for MySQL 5.7replication

Shulou Source: shulou.com Published: 2022-05-31 14:04:17 10月03日 Update

This article will explain in detail what the filtering parameters are about MySQL 5.7replication, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

1. Library-level filter parameters

-- A library for binlog-do-db=db_name Master nodes to record binary logs

-- A library where the binlog-ignore-db=db_name Master node does not record binary logs

-- A library of replicate-do-db=db_name Slave node application logs

-- A library that does not apply logs to replicate-ignore-db=db_name Slave nodes

2. Table-level filtering parameters

-- the replicate-do-table=db_name.tbl_name Slave node executes the modification event of the specified table

-- the replicate-wild-do-table=db_name.tbl_name Slave node executes the modification event that contains the specified table in the rule

-- the replicate-ignore-table=db_name.tbl_name Slave node does not execute the modification event of the specified table

-- the replicate-wild-ignore-table=db_name.tbl_name Slave node does not execute the modification event containing the specified table in the rule

There are startup parameters and system parameters in MySQL. Startup parameters cannot be queried through show variables and can be found in the options of mysqld.

For example, there are Startup Options Used with Binary Logging and System Variables Used with Binary Logging parameters for binary logs.

The replication filtering parameters mentioned above are all startup parameters.

Set parameters

[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

After starting the database, view the parameters

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)

Which filter parameters about MySQL 5.7replication are shared here, I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Parameters nodes logs events binaries content articles more regularities knowledge articles applications yes said data databases systems quality references help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn OPPO Reno MariaDB Xiaomi Docker