gpt4 book ai didi

mysql - 如何理解mysql binlog中的时间戳?

转载 作者:行者123 更新时间:2023-11-29 02:26:23 34 4
gpt4 key购买 nike

二进制日志总是这样的:

#140105 18:49:33 server id 2  end_log_pos 354   Query   thread_id=1     exec_time=0     error_code=0
SET TIMESTAMP=1388918973/*!*/;
/* some SQL statement */
/*!*/;

官方网站的插图是:

In the first line, the number following at indicates the starting position of the event in the binary log file.

The second line starts with a date and time indicating when the statement started on the server where the event originated. For replication, this timestamp is propagated to slave servers. server id is the server_id value of the server where the event originated. end_log_pos indicates where the next event starts (that is, it is the end position of the current event + 1). thread_id indicates which thread executed the event. exec_time is the time spent executing the event, on a master server. On a slave, it is the difference of the end execution time on the slave minus the beginning execution time on the master. The difference serves as an indicator of how much replication lags behind the master. error_code indicates the result from executing the event. Zero means that no error occurred.

它说“第二行以日期和时间开始”,似乎这种日期时间格式与“SET TIMESTAMP”子句有很大不同,其中数字表示从 1970 年到1-1,但是“#140105 18:49:33”是什么意思,那是那个日期?

最佳答案

140105 表示 YYMMDD。

2014 年 1 月 5 日(01)

明明是18:49:33时间

关于mysql - 如何理解mysql binlog中的时间戳?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20933500/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com