Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check event scheduler status mysql

In MySQL, we can enable the event scheduler by following query:

SET GLOBAL event_scheduler = ON; 

Similarly, to turn off the scheduler:

SET GLOBAL event_scheduler = OFF; 

But, Is there any query/way to check the status of this event_scheduler whether it's on or off?

like image 973
GorvGoyl Avatar asked Aug 26 '16 05:08

GorvGoyl


People also ask

How do I know if MySQL event is running?

SELECT * FROM INFORMATION_SCHEMA. events; You can also use SHOW CREATE EVENT yourevent to see what it does.

How do I enable event scheduler status in MySQL?

To enable the Event Scheduler, restart the server without the --event-scheduler=DISABLED command-line option, or after removing or commenting out the line containing event-scheduler=DISABLED in the server configuration file, as appropriate.

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.

How do I start an event in MySQL?

Assuming you have MySQL rights to create events, the basic syntax is: CREATE EVENT `event_name` ON SCHEDULE schedule [ON COMPLETION [NOT] PRESERVE] [ENABLE | DISABLE | DISABLE ON SLAVE] DO BEGIN -- event body END; The schedule can be assigned various settings, e.g.


1 Answers

Use SHOW VARIABLES

SHOW VARIABLES WHERE VARIABLE_NAME = 'event_scheduler' 
like image 80
Nick Avatar answered Sep 27 '22 01:09

Nick