0

I've created the following event, but for some reason it's not getting triggered:

CREATE EVENT Del_logs
ON SCHEDULE EVERY 1 HOUR
DO
    TRUNCATE TABLE security.errors;

Is there any log I could check to see what went wrong?

Cornwell
  • 3,304
  • 7
  • 51
  • 84
  • Are you sure your server is on the same timezone as you are? Try setting the start date to 2 days ago to see. – Fabien Warniez Jan 23 '14 at 23:36
  • The error log file is generally `/var/log/mysqld.log` but if you're on a hosted system you might not have access to it. Not all hosted systems have the event scheduler enabled. You should check with your ISP –  Jan 23 '14 at 23:36
  • The server is dedicated, I have full root access to it and it is on the same timezone. Could it be some MariaDB incompatibility with events? The error log seems to be empty – Cornwell Jan 23 '14 at 23:50

1 Answers1

9

It looks like the event scheduler is OFF.

  • use SHOW PROCESSLIST to check if the event scheduler is enabled. If it's ON you should see a process "Daemon" by user "event_scheduler".
  • use

    SET GLOBAL event_scheduler = ON;
    

    to enable the scheduler if it's currently not enabled.

  • More on configuring event scheduler read here

peterm
  • 91,357
  • 15
  • 148
  • 157