MySQL Show Binlog Events Introduction

Source: Internet
Author: User

Show Binlog events;
View only the contents of the first Binlog file:

Mysql> Show Binlog events;+------------------+-----+-------------+------------+-------------+----------------- ---------------------------------------------------------------------------------+| Log_name | Pos | Event_type | server_id | End_log_pos | Info |+------------------+---- -+-------------+------------+-------------+-------------------------------------------------------------------- ------------------------------+|   mysql-bin.000019 | 4 | Format_desc |         1132333306 | 120 | Server ver:5.6.36-log, Binlog ver:4 | | mysql-bin.000019 | 120 | Query |         1132333306 | 196 | BEGIN | | mysql-bin.000019 | 196 | Query |         1132333306 | 363 | Update Mysql.user set Password=password (' [email protected] ') where uSer= ' root ' and host= ' 127.0.0.1 ' | | mysql-bin.000019 | 363 | Query |         1132333306 | 440 | COMMIT | | mysql-bin.000019 | 440 | Query |         1132333306 | 519 | Flush Privileges | | mysql-bin.000019 | 519 | Stop |         1132333306 |                                                                                                  542 | |+------------------+-----+-------------+------------+-------------+------------------------------------------- -------------------------------------------------------+6 rows in Set (0.00 sec)

See all Binlog:

mysql> show  master logs;+------------------+-----------+| Log_name         | File_size |+------------------+-----------+| mysql-bin.000019 |       542 || mysql-bin.000020 |       143 || mysql-bin.000021 |       543 || mysql-bin.000022 |      1681 || mysql-bin.000023 |       385 || mysql-bin.000024 |      1708 || mysql-bin.000025 |      2521 |+------------------+-----------+7 rows in set (0.00 sec)

To view the Binlog file that is currently being written:

mysql> show master status\G*************************** 1. row ***************************             File: mysql-bin.000025         Position: 2521     Binlog_Do_DB:  Binlog_Ignore_DB: Executed_Gtid_Set: 1 row in set (0.00 sec)

View the contents of the specified Binlog file:
Mysql> show Binlog events in ' mysql-bin.000025 ';

Tested: The default library operation for MySQL is supported by SQL statements for update, delete,alter,create, Revoke,grant,drop operations.
However, the DDL operation of the new library SQL statement For example: Create,drop, alter can view the resulting

MySQL Show Binlog Events Introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.