为什么 MySQL 5.7 Even Scheduler START 日期时间与 CREATE/ALTER EVENT START 时间不匹配?

Why does MySQL 5.7 Even Scheduler START datetime not match with the CREATE/ALTER EVENT START time?

创建活动后...

DELIMITER $$
CREATE DEFINER=`abc`@`localhost` EVENT `testEventYearly` ON SCHEDULE EVERY 1 YEAR STARTS '2018-01-01 00:00:00' ON COMPLETION PRESERVE ENABLE DO BEGIN
CALL `spTestEventYearly` ();
END$$

...我查看 mysql.event table 并看到 starts 值为 2018-01-01 06:00:00。我检查了服务器上的 date/time,一切正常。为什么会有时间上的差异?它会在 06:00 还是 00:00 执行?

https://dev.mysql.com/doc/refman/5.7/en/create-event.html 说:

Times in the ON SCHEDULE clause are interpreted using the current session time_zone value. This becomes the event time zone; that is, the time zone that is used for event scheduling and is in effect within the event as it executes. These times are converted to UTC and stored along with the event time zone in the mysql.event table. This enables event execution to proceed as defined regardless of any subsequent changes to the server time zone or daylight saving time effects.

(强调我的)

我推断你在美国中部时区。您在本地时区为 UTC -0600 时创建了事件,然后 mysql.event 中存储的值比 UTC 提前了六个小时。