MySQL CREATE EVENT 语法错误

发布于 2024-12-29 05:21:50 字数 670 浏览 0 评论 0原文

编辑:我发现我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烧了回忆取暖 2025-01-05 05:21:50

我使用的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文