SHOW BINLOG EVENTS [IN 'log_name
'] [FROMpos
] [LIMIT [offset
,]row_count
]
Shows the events in the binary log. 显示二进制日志中的事件。If you do not specify 如果未指定'
, the first binary log is displayed. log_name
''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语句”。
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
为二进制日志中的每个事件显示以下字段:
Log_name
The name of the file that is being listed.正在列出的文件的名称。
Pos
The position at which the event occurs.事件发生的位置。
Event_type
An identifier that describes the event type.描述事件类型的标识符。
Server_id
The server ID of the server on which the event originated.事件发生在其上的服务器的服务器ID。
End_log_pos
The position at which the next event begins, which is equal to 下一个事件开始的位置,等于Pos
plus the size of the event.Pos
加上事件大小。
Info
More detailed information about the event type. 有关事件类型的更多详细信息。The format of this information depends on the event type.此信息的格式取决于事件类型。
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
。