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