Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql- master-slave-binlog- format, parameters (3)

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Log format ROW:

The pattern based on [data rows] is to record all the changed data:

Advantages: stability will not have bug disadvantages: log files are large STATEMENT:

The pattern based on [sql statement] is to record all executed sql statements.

Pros: small disadvantages of log files: there may be bug with abnormal execution of functions in different versions of mysql, such as sleepMIXED

Mixed mode: the mixing of the first two modes is automatically selected according to the specific sql,mysql, and the [ROW mode] is optimized.

View the current type: show variables like 'binlog_format' Modify mode-statement mode: vim / etc/my.cnfbinlog_format=STATEMENT view binlog content: / / General view: mysqlbinlog mysql.bin.0003// displays specific execution information: mysqlbinlog mysql.bin.0003-v _ mysqlbinlog mysql.bin.0003 / remove base64 symbol: mysqlbinlog mysql.bin.0003-v-- base64-output=decode filter parameters are generally not restricted on the host. Restrict slave database # Parameter (my.cnf): # Master database (binlog log record filtering): binlog-do-db # copy only-specified database binlog-ignore-db # do not copy-specified database # Slave database (relay log record filtering): replicate_do_db # copy only-specify Database replicate_ignore_db # does not replicate-specified database replicate_do_table # only replicates-specified data table replicate_ignore_table # does not copy-specified data table replicate_wild_do_table # only replicates-specified data table Use [wildcard] replicate_wild_ignore_table # not to copy-the specified data table, and use [wildcard] example configuration: # 1. [slave] Only copy [xh library], exclude [user table] replicate_do_db=xhreplicate_ignore_table=xh.user# 2. [slave library], copy only [xh library], and exclude the table replicate _ do_db=xhreplicate_wild_ignore_table=xh.test% that begins with test

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report