Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set global event_scheduler=ON even if MySQL is restarted?

I want to set the event_scheduler global to ON even if MySQL is restarted; how can I achieve this?

SET GLOBAL event_scheduler = ON; 
like image 605
nakul Avatar asked Nov 21 '13 04:11

nakul


People also ask

How do I create a recurring event in MySQL?

Creating new MySQL events First, specify the name of the event that you want to create the CREATE EVENT keywords. The event names must be unique within the same database. Second, specify a schedule after the ON SCHEDULE keywords. Third, place SQL statements after the DO keyword.

How do I stop a scheduled event in MySQL?

SET GLOBAL event_scheduler = OFF; SET @@global. event_scheduler = OFF; SET GLOBAL event_scheduler = 0; SET @@global. event_scheduler = 0; but it stops all 5 event Scheduler.


1 Answers

You can set

event_scheduler=ON 

in my.ini or my.cnf file, then restart your server for the setting to take effect.

Once set event_scheduler will always remain ON no matter whether your server restarts.

like image 196
prem Avatar answered Sep 28 '22 01:09

prem