13.7.7.2 SHOW BINLOG EVENTS Statement语句

SHOW BINLOG EVENTS
   [IN 'log_name']
   [FROM pos]
   [LIMIT [offset,] row_count]

Shows the events in the binary log. 显示二进制日志中的事件。If you do not specify 'log_name', the first binary log is displayed. 如果未指定'log_name',将显示第一个二进制日志。SHOW BINLOG EVENTS requires the REPLICATION SLAVE privilege.SHOW BINLOG EVENTS需要REPLICATION SLAVE权限。

The LIMIT clause has the same syntax as for the SELECT statement. LIMIT子句的语法与SELECT语句的语法相同。See Section 13.2.10, “SELECT Statement”.请参阅第13.2.10节,“SELECT语句”

Note注意

Issuing a SHOW BINLOG EVENTS with no LIMIT clause could start a very time- and resource-consuming process because the server returns to the client the complete contents of the binary log (which includes all statements executed by the server that modify data). 发出不带LIMIT子句的SHOW BINLOG EVENTS可能会启动一个非常耗费时间和资源的过程,因为服务器会将二进制日志的完整内容(包括服务器执行的所有修改数据的语句)返回给客户端。As an alternative to SHOW BINLOG EVENTS, use the mysqlbinlog utility to save the binary log to a text file for later examination and analysis. 作为SHOW BINLOG EVENTS的替代方法,使用mysqlbinlog实用程序将二进制日志保存到文本文件中,以供以后检查和分析。See Section 4.6.9, “mysqlbinlog — Utility for Processing Binary Log Files”.请参阅第4.6.9节,“mysqlbinlog-处理二进制日志文件的实用程序”

SHOW BINLOG EVENTS displays the following fields for each event in the binary log:SHOW BINLOG EVENTS为二进制日志中的每个事件显示以下字段:

For compressed transaction payloads, the Transaction_payload_event is first printed as a single unit, then it is unpacked and each event inside it is printed.对于压缩的事务有效负载,首先将Transaction_payload_event作为单个单元打印,然后将其解压缩并打印其中的每个事件。

Some events relating to the setting of user and system variables are not included in the output from SHOW BINLOG EVENTS. SHOW BINLOG EVENTS的输出中不包括与用户和系统变量设置相关的一些事件。To get complete coverage of events within a binary log, use mysqlbinlog.要在二进制日志中完全覆盖事件,请使用mysqlbinlog

SHOW BINLOG EVENTS does not work with relay log files. SHOW BINLOG EVENTS不适用于中继日志文件。You can use SHOW RELAYLOG EVENTS for this purpose.为此,可以使用SHOW RELAYLOG EVENTS