MySQL CREATE EVENT 语法错误
编辑:我发现我的 MySQL 版本不支持它。我运行5.0.91,它需要5.1左右。我假设语法是正确的。感谢您的帮助。
我刚刚创建了这个 mysql 事件,该事件应该每小时运行一次。但是,我不断收到此错误:
#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
这是我的代码:
DELIMITER //
CREATE EVENT event_upcomingbattle
ON SCHEDULE EVERY 1 HOUR
STARTS CURRENT_TIMESTAMP
DO
CALL update_upcomingbattle();
END//
DELIMITER ;
我错过了一些愚蠢的东西吗? update_upcomingbattle()
过程存在。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用的 MySQL 版本不支持事件。 MySQL 5.1.6 中添加了事件支持。相反,我运行的是 5.0.91。我一更新MySQL,它就开始工作了。
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.