V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
fileinthehole
V2EX  ›  MySQL

mysql 设置定时任务为什么没有执行?

  •  
  •   fileinthehole · 2019-09-24 09:10:46 +08:00 · 5165 次点击
    这是一个创建于 1670 天前的主题,其中的信息可能已经有所发展或是发生改变。

    DELIMITER ;;

    ALTER DEFINER=root@localhost EVENT user_daily_partition ON SCHEDULE EVERY 1 DAY STARTS '2019-09-23 23:59:50' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
    CALL test.user_new_partition;
    END;;

    DELIMITER ;;

    事件代码如上,单独调用 user_new_partition 存储过程可以完成对 user 表的分区,但是自己将电脑时间手动改为 24 号的 23:59:50 秒之前时间,本想着时间到就能自动执行事件,完成每日调用一次存储过程,但是一直没有执行成功,请各位慧眼帮忙瞧一瞧问题出在哪里。

    5 条回复    2019-09-24 14:11:50 +08:00
    fileinthehole
        1
    fileinthehole  
    OP
       2019-09-24 09:14:03 +08:00
    对了,那个 show variables like 'event_scheduler'; 已经是 ON 状态了
    jjianwen68
        2
    jjianwen68  
       2019-09-24 09:17:27 +08:00
    看 mysql error 日志文件中有没有错误日志
    fileinthehole
        3
    fileinthehole  
    OP
       2019-09-24 09:47:35 +08:00
    @jjianwen68 里面没有什么信息啊
    white1222
        4
    white1222  
       2019-09-24 14:06:01 +08:00
    你这 call 有问题吧
    fileinthehole
        5
    fileinthehole  
    OP
       2019-09-24 14:11:50 +08:00
    @white1222 哪里有问题?我单独 CALL 都没问题啊,而且有问题的话创建事件的时候会报错吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2720 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:14 · PVG 20:14 · LAX 05:14 · JFK 08:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.