change Event Scheduler status in mysql

后端 未结 3 1158
难免孤独
难免孤独 2021-01-12 23:44

I have 5 event Scheduler in my MySql data base. I want to stop one event Scheduler from them.

I have used below statements,

SET GLOBAL event_schedule         


        
相关标签:
3条回答
  • 2021-01-13 00:10

    If you need to get the current global event status, this may be useful for you;

    select @@global.event_scheduler;
    
    0 讨论(0)
  • 2021-01-13 00:16

    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

    0 讨论(0)
  • 2021-01-13 00:19

    One thing to consider :

    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. In such case to disable the event scheduler, use one of the following two methods:

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

      --event-scheduler=DISABLED

    • In the server configuration file (my.cnf, or my.ini on Windows systems), include the line where it will be read by the server (for example, in a [mysqld] section):

      event_scheduler=DISABLED

    https://dev.mysql.com/doc/refman/5.7/en/events-configuration.html

    0 讨论(0)
提交回复
热议问题