mysql event doesn't work

浪子不回头ぞ 提交于 2019-12-10 20:48:56

问题


Hi I have this event stored in the event table of the information schema:

event_catalog:def
event_schema: m4af
event_name:aggiornaGiorni
definer:root@localhost
timezone:system
event_body:sql
event_definition:update m4af.utentibloccati set giorni=giorni+1
event_type:recurring
execute at: null
interval_value:1
interval_field:day
sql_mode:STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
starts:2012-11-26 11:40:41
ends:null
status:enabled
on_completion:not preserve
created:2012-11-26 11:40:41
last_altered:2012-11-26 11:40:41
 last_executed:2012-11-26 11:40:41
event_comment: ""
originator:0
character_set_client:utf8
collocation_connection:utf8_general_ci
database_collation:utf8_general_ci

Why this event does not increments the value day of my table named utentibloccati ?


回答1:


The events are executed by a special event scheduler thread; and it is very possible that event scheduler thread was not started. Check it using this query -

SELECT @@global.event_scheduler;

The result should be - ON. Otherwise, execute this query to start event scheduler -

SET @@global.event_scheduler = 1;

Event Scheduler Configuration.



来源:https://stackoverflow.com/questions/13679252/mysql-event-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!