1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 如何编辑mysql中events的executeat如何使用 – 数据库 – 前端 mysql 查询时间差天数

如何编辑mysql中events的executeat如何使用 – 数据库 – 前端 mysql 查询时间差天数

时间:2019-10-20 08:03:31

相关推荐

如何编辑mysql中events的executeat如何使用 – 数据库 – 前端 mysql 查询时间差天数

测试过程

创建测试数据库

创建测试数据表

创建Event

执行SQL语句查询mysqld实例的时区和时间

执行SQL语句查询information_schema.events表和mysql.event表中execute_at和last_executed字段值

问题原因

为了确保Event的执行不受时区的影响,使得Event可以准确执行,MySQL将mysql.event表的事件调度时间(execute_at和last_executed)转换成UTC时间。

文档描述:

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.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。