0

I am trying to create a reccurring event that should occur every day and with no end date. So I went with:

CREATE DEFINER=`xxx`@`xxx` EVENT `my_event` ON SCHEDULE EVERY 1 DAY STARTS '2016-08-23 08:00:00' ON COMPLETION PRESERVE ENABLE DO TRUNCATE TABLE `my_table`

Now, my issue is that the event seems to stop working after a while. Maybe after a reboot? What could do this? The mysql error.log is empty. How can I debug this ?

And by the way, am I right to select preserve on completion?

EDIT Ok, I think that I found here the solution to my problem. So I guess that I should put the line

event_scheduler=ON

at the bottom of the [mysqld] section of the file /etc/mysql/mysql.conf.d/mysqld.cnf

I just need to restart to be sure, but I can't do that right now.

Community
  • 1
  • 1
Sharcoux
  • 5,546
  • 7
  • 45
  • 78
  • what does this get you: `show variables where variable_name='event_scheduler';` ... and yes preserve – Drew Sep 29 '16 at 07:23
  • Well... Event_scheduler : OFF. This means that it is getting disabled. Might it be during reboot? – Sharcoux Sep 29 '16 at 07:35

1 Answers1

0

Ok, I think that I found here the solution to my problem.

The version in this link is not the same as mine. With the current version it seems that I have to put

event_scheduler=ON

at the bottom of the [mysqld] section of the file /etc/mysql/mysql.conf.d/mysqld.cnf

After reboot, it is working.

Community
  • 1
  • 1
Sharcoux
  • 5,546
  • 7
  • 45
  • 78