Pregunta

Edit: I've figured out my MySQL version doesn't support it. I run 5.0.91, it requires 5.1 or so. I'm assuming the syntax is correct. Thanks for the help.

I've just created this mysql event that's supposed to be run every hour. However, I keep getting this error:

#1064 - 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 event_upcomingbattle ON SCHEDULE EVERY 1 HOUR STARTS CURRENT_TIMESTAMP' at line 1

This is my code:

DELIMITER //
CREATE EVENT event_upcomingbattle
    ON SCHEDULE EVERY 1 HOUR
    STARTS CURRENT_TIMESTAMP
    DO
        CALL update_upcomingbattle();
    END//
DELIMITER ;

Am I missing something stupid? The update_upcomingbattle() procedure exists.

¿Fue útil?

Solución

The MySQL version I was using did not support events. Event support was added in MySQL 5.1.6. Instead, I was running 5.0.91. As soon as I updated MySQL, it started working.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top