When i'm trying to create an EVENT in my MySQL getting this error
Script line: 1 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'EVENT `e_hourly`
ON SCHEDULE
EVERY 1 HOUR
COMMENT 'Clears out s' at line 1
I'm attaching my create EVENT code here
CREATE EVENT `e_hourly`
ON SCHEDULE
EVERY 1 HOUR
COMMENT 'Clears out sessions table each hour.'
DO call testing();#here i'm trying to call a stored proc
Your Event Code seems to be fine, perhaps you don't have support for events in your mysql version?
We usually format events as:
DELIMITER $$
DROP EVENT IF EXISTS E_Hourly$$
CREATE EVENT E_Hourly ON SCHEDULE EVERY 1 HOUR COMMENT 'Clears out sessions table each hour' DO
EV:BEGIN
CALL Testing();
END$$
DELIMITER ;
SET GLOBAL event_scheduler = ON;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With