MySQL 5.6 events are created disabled and they don’t run

eventMySQL

I am using the normal syntax to create an event, but they are created disabled and they never run:

create event p1 on schedule at now() on completion preserve enable do call proc1();

I added enable although it is default to solve this problem, but no good as well, and I need to preserve the event such that I can find it show events / select * from information_scheme.events;

I appreciate your help very much with any privileges required, configuration, or syntax to solve this problem.

Best Answer

You didn't specify the interval

create event p1
    on schedule
    every week
    at now()
on completion preserve
enable do call proc1();

I have several examples of how to set up events

BTW make sure you enable the croning mechanism in my.cnf by adding this line

[mysqld]
event_scheduler = 'ON';

You don't have to reboot. Just run this

mysql> SET GLOBAL event_scheduler = 'ON';

As the last step, you can create the event.