content_image/702671.jpg
State: NULL Info: show processlist *************************** 2. row *************************** Id: 2 User: event_scheduler Host: localhost db: NULL Command: Daemon Time: 3 State: Waiting for next activation Info: NULL 2 rows in set (0.00 sec) 

Event scheduling can be stopped by setting the value of event_scheduler  to OFF . 

• OFF : The Event Scheduler is stopped. The event scheduler thread does not run, is not shown in the output of SHOW PROCESSLIST , and no scheduled events are executed. 

When the Event Scheduler is stopped ( event_scheduler  is OFF ), it can be started by setting the value of event_scheduler  to ON . (See next item.) 

• DISABLED : This value renders the Event Scheduler nonoperational. When the Event Scheduler is DISABLED , the event scheduler thread does not run (and so does not appear in the output of SHOW PROCESSLIST ). In addition, the Event Scheduler state cannot be changed at runtime. 

If the Event Scheduler status has not been set to DISABLED , event_scheduler  can be toggled between ON  and OFF  (using SET ). It is also possible to use 0  for OFF , and 1  for ON  when setting this variable. Thus, any of the following 4 statements can be used in the mysql  client to turn on the Event Scheduler: 

SET GLOBAL event_scheduler = ON; SET @@GLOBAL.event_scheduler = ON; SET GLOBAL event_scheduler = 1; SET @@GLOBAL.event_scheduler = 1; 

Similarly, any of these 4 statements can be used to turn off the Event Scheduler: 

SET GLOBAL event_scheduler = OFF; SET @@GLOBAL.event_scheduler = OFF; SET GLOBAL event_scheduler = 0; SET @@GLOBAL.event_scheduler = 0; 

Although ON  and OFF  have numeric equivalents, the value displayed for event_scheduler  by SELECT  or SHOW VARIABLES  is always one of OFF , ON , or DISABLED . DISABLED  has no numeric equivalent . For this reason, ON  and OFF  are usually preferred over 1  and 0  when setting this variable. 

Note that attempting to set event_scheduler  without specifying it as a global variable causes an error: 

mysql< SET @@event_scheduler = OFF; ERROR 1229 (HY000): Variable ’event_scheduler’ is a GLOBAL variable and should be set with SET GLOBAL 

<img src='content_image/702671.jpg'>

To disable the event scheduler, use one of the following two methods: 

•As a command-line option when starting the server: 

Important 

It is possible to set the Event Scheduler to DISABLED  only at server startup. If event_scheduler  is ON  or OFF , you cannot set it to DISABLED  at runtime. Also, if the Event Scheduler is set to DISABLED  at startup, you cannot change the value of event_scheduler  at runtime. 

