mysqldatabaseeventsschedulermysql-event

Change event scheduler status in MySQL


I'm trying to stop only one event but the SQL below stops all events:

SET GLOBAL event_scheduler = OFF;

Or:

SET @@global.event_scheduler = OFF;

Or:

SET GLOBAL event_scheduler = 0;

Or:

SET @@global.event_scheduler = 0;

So, how can I stop only one event?


Solution

  • I think you mean that you have 5 events on one scheduler. Right?

    Here is how you disable one event:

        ALTER EVENT myevent
        DISABLE;
    

    Here is how you disable the entire scheduler (all events):

        SET GLOBAL event_scheduler = OFF;
    

    All this can be read at http://dev.mysql.com/doc/refman/5.1/en/events.html How to disable one event is here http://dev.mysql.com/doc/refman/5.1/en/alter-event.html