如何编辑mysql中events的execute at如何使用
答案:3 悬赏:50 手机版
解决时间 2021-03-25 21:15
- 提问者网友:心牵心
- 2021-03-25 17:14
如何编辑mysql中events的execute at如何使用
最佳答案
- 五星知识达人网友:冷風如刀
- 2021-03-25 17:28
一次意外的发现创建完Event之后,information_schema.events和mysql.event表中execute_at和last_executed字段均相差8个小时,mysqld实例的时区为:
测试过程
创建测试数据库
创建测试数据表
创建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.
测试过程
创建测试数据库
创建测试数据表
创建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.
全部回答
- 1楼网友:老鼠爱大米
- 2021-03-25 18:01
1. 通过我们调用的方法,如本例中的 selectAuthUserByName ,接口名来组合成语句。本例中是 com.mybatis.dao.AuthUserDao.selectAuthUserByName 。其实使用过sqlSession的selectOne(String statmet)之类的语句都知道。这个可以唯一定位到我们在sql映射文件中配置的sql语句
2. 通过返回值类型,定位到的语句的类型。确定最后应该执行的方法。是执行查询、删除、添加、修改等等。
2. 通过返回值类型,定位到的语句的类型。确定最后应该执行的方法。是执行查询、删除、添加、修改等等。
- 2楼网友:慢性怪人
- 2021-03-25 17:39
一次意外的发现创建完Event之后,information_schema.events和mysql.event表中execute_at和last_executed字段均相差8个小时,mysqld实例的时区为:
测试过程 创建测试数据库 创建测试数据表 创建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.
测试过程 创建测试数据库 创建测试数据表 创建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.
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯