Reputation: 4514
I created an MySql event a few days ago. I don't think it has run. If I do SHOW EVENTS
It started on 2015-09-07 00:00:00
and it has an interval of WEEK
. Today is 2015-09-14
and it is well after midnight. It has a status of ENABLED. How do I know a) when it last ran, b) what it is supposed to do.
I created an SP which it was supposed to run. I tested this at the time but there is not sign that the SP has been run.
Is there any easy way to debug this? Or even a hard way?!
Upvotes: 33
Views: 46566
Reputation: 1
You can show all events in more detail than SHOW EVENTS with the SQL below, then LAST_EXECUTED
column shows when they last ran. *The doc explains INFORMATION_SCHEMA.events
table and I recommend to use \G which can show them more clearly and my answer explains how to show events with SHOW EVENTS
:
SELECT * FROM INFORMATION_SCHEMA.events;
Or:
SELECT * FROM INFORMATION_SCHEMA.events\G
And, you can show all the events running currently with the SQL below:
SELECT * FROM INFORMATION_SCHEMA.events WHERE STATUS = 'ENABLED';
Or:
SELECT * FROM INFORMATION_SCHEMA.events WHERE STATUS = 'ENABLED'\G
And, you can show all the events not running currently with the SQL below:
SELECT * FROM INFORMATION_SCHEMA.events WHERE STATUS = 'DISABLED';
Or:
SELECT * FROM INFORMATION_SCHEMA.events WHERE STATUS = 'DISABLED'\G
Upvotes: 0