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

Common options for mysqlbinlog parsing binlog

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly gives you a brief introduction to the common options for mysqlbinlog parsing binlog. You can look up the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here, so let's go straight to the topic of common options for mysqlbinlog parsing binlog. I hope we can bring you some practical help.

-- base64-output=name

Determine binlog output format options

'never' option

Do not output Sql statement format

'decode-rows' option

Convert the output statement format to the annotated SQL statement format, because most of the binlog logs are now rows logs, not statement logs, so the conversion statement output is only the rows changed statement, not the sql statement entered at that time.

If there is no-- base64-output [= name] option, all formats are given by default, and the default is' auto'.

Automatic ("auto") or unspecified ("UNSPEC") automatically displays all formats of BINLOG statements (that is, binary format and statement format).

If not, the-- base64-output option gives the same effect as-- base64-output=AUTO.

-- start-datetime=name

The specified time to start reading the binlog log, the time zone is the log's local time zone, and the time format example is' 2016-12-25 11:25:56'(use quotation marks to avoid recognition errors in shell.)

-- stop-datetime=name

Stop reading the binlog log at the specified time, the time zone is the log's local time zone, and the time format example is' 2016-12-25 11:25:56'(use quotation marks to avoid recognition errors in shell.)

-- start-position=#

Start reading the binlog log at the specified position number. The reading range is more accurate and time zone errors can be avoided. It is recommended to use it when recovering data.

-- stop-position=#

Stop reading binlog logs at the specified position number. The reading range is more accurate and time zone errors can be avoided. It is recommended to use it when recovering data.

-v rebuilds the pseudo-sql statement from the line event.

-vv rebuilds the pseudo-sql statement from the row event, adding comments to the data type.

-- database=name

Specify the exported database

-- skip-gtids

The global transaction ID number is ignored on output.

Export binlog logs within the time range, rebuild pseudo sql statements from line events, use SQL statements to encode, if there are multiple binlog files, use > > to add to the export file, use absolute path as far as possible.

Mysqlbinlog-v-- base64-output=decode-rows-- start-datetime='2016-12-25 11 start-datetime='2016 56'\-- stop-datetime='2016-12-25 11 start-datetime='2016 59 binlogname > filename.sql

Capture the exact range of position numbers and export the sql file.

Mysqlbinlog-- start-position=10000-- stop-position=20000 binlogname > filename.sql

Mysql for data import.

Mysql-upright user'-paired password'< filename.sql # dangerous operation!

Mysqlbinlog parsing binlog common options to tell you here, for other related issues you want to know can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.

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

Database

Wechat

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

12
Report