Relational Database ServiceRelational Database Service

Compute
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
Domain Name Service
VPC Endpoint
Cloud Connect
Enterprise Switch
Security & Compliance
Anti-DDoS
Web Application Firewall
Host Security Service
Data Encryption Workshop
Database Security Service
Advanced Anti-DDoS
Data Security Center
Container Guard Service
Situation Awareness
Managed Threat Detection
Compass
Cloud Certificate Manager
Anti-DDoS Service
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GaussDB NoSQL
GaussDB(for MySQL)
Distributed Database Middleware
GaussDB(for openGauss)
Developer Services
ServiceStage
Distributed Cache Service
Simple Message Notification
Application Performance Management
Application Operations Management
Blockchain Service
API Gateway
Cloud Performance Test Service
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
DevCloud
ProjectMan
CodeHub
CloudRelease
CloudPipeline
CloudBuild
CloudDeploy
Cloud Communications
Message & SMS
Cloud Ecosystem
Marketplace
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP License Service
Support Plans
Customer Operation Capabilities
Partner Support Plans
Professional Services
enterprise-collaboration
Meeting
IoT
IoT
Intelligent EdgeFabric
DeveloperTools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Updated at: Apr 02, 2022 GMT+08:00

Downloading mysqlbinlog

Scenarios

The mysqlbinlog tool is used to parse binlogs and is contained in the MySQL software package. You can download a MySQL software package of your desired version from the MySQL official website, decompress the package, and obtain the mysqlbinlog tool from the decompressed package (mysqlbinlog 3.4 is for MySQL 5.6 and 5.7). If your mysqlbinlog version is too old to correctly parse MySQL binlogs, perform the operations described in this section.

Procedure

  1. Download a MySQL software package.

    It is recommended that the software package version be the same as your current MySQL major version.

    If your MySQL version is 5.7.27, download the following software packages:

    • Product Version: 5.7.27
    • Operating System: Linux-Generic

    The downloaded MySQL software package is mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz.

    Figure 1 Download
  1. Decompress the software package and find the mysqlbinlog tool.
  2. Find the mysqlbinlog tool version.
    [root@ecs]# tar -zxf mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
    [root@ecs]# cd mysql-5.7.27-linux-glibc2.12-x86_64/bin
    [root@ecs]# ll mysqlbinlog
    -rwxr-xr-x 1 7161 31415 11310886 Jun 10 2019 mysqlbinlog
    [root@ecs]# ./mysqlbinlog -V
    ./mysqlbinlog Ver 3.4 for linux-glibc2.12 at x86_64
  3. Use mysqlbinlog to parse binlogs.
    The following uses mysql-bin.000001 as an example:
    [root@ecs]# ./mysqlbinlog --no-defaults -vv /root/mysql-bin.000001
    /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
    /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
    DELIMITER /*!*/;
    # at 4
    #200316 17:54:14 server id 1 end_log_pos 126 CRC32 0x92b3f2ca Start: binlog v
    4, server v 5.7.27-5-debug-log created 200316 17:54:14 at startup
    ROLLBACK/*!*/;
    BINLOG '
    xkxvXg8BAAAAegAAAH4AAAAAAAQANS43LjI3LTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAADGTG9eEzgNAAgAEgAEBAQEEgAAYgAEGggAAAAICAgCAAAACgoKKioAEjQA
    Xz0AAcrys5I=
    '/*!*/;
    # at 126
    #200316 17:54:14 server id 1 end_log_pos 157 CRC32 0xfcc47ad6 Previous-GTIDs
    # [empty]
    # at 157
    #200316 17:54:27 server id 1 end_log_pos 204 CRC32 0xa7febd1f Rotate to mysqlbin.
    000002 pos: 4
    SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
    DELIMITER ;
    # End of log file
    /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
    /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;

Did you find this page helpful?

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel