• 2.事件每天执行


    1.开启事件

    修改 my.cnf

    [mysqld]
    event_scheduler=ON
    group_concat_max_len=1024000
    character_set_server=utf8
    general_log=ON
    general_log_file=/etc/mysql/log/general.log
    log_error=/etc/mysql/log/error.log

    或者

      set global event_scheduler=ON

    2.创建事件

    delimiter $$
    CREATE EVENT FLUSH_TEST
    ON SCHEDULE EVERY 1 DAY STARTS TIMESTAMP '2018-02-25 00:00:00'
    DO
    BEGIN
        INSERT INTO clarify_issue(statistics_time,project,issuekey,summary,`owner_job_id`,`owner`,duedate,reopentime_or_overduedays)
        SELECT report_time,project_name,jira_id,summary,resolver,resolver_displayName,duedate,reopen_time AS 'reopentime_or_overduedays' FROM work_huaqin.daily_reopen_Bug
        WHERE report_time=CURRENT_DATE()
        UNION ALL
        SELECT report_time,project_name,jira_id,summary,resolver,resolver_displayName,duedate,reopen_time AS 'reopentime_or_overduedays' FROM work_huaqin.daily_reopen_Task
        WHERE report_time=CURRENT_DATE()
        UNION ALL
        SELECT report_time,project_name,jira_id,summary,resolver,resolver_displayName,duedate,reopen_time AS 'reopentime_or_overduedays' FROM tb_liverpool.daily_reopen
        WHERE report_time=CURRENT_DATE()
        UNION ALL
        SELECT report_time,project_name,jira_id,summary,resolver,resolver_displayName,duedate,reopen_time AS 'reopentime_or_overduedays' FROM rainbow.daily_reopen
        WHERE report_time=CURRENT_DATE()
        UNION ALL
        SELECT report_time,project_name,jira_id,summary,resolver,resolver_displayName,duedate,reopen_time AS 'reopentime_or_overduedays' FROM basin.daily_reopen
        WHERE report_time=CURRENT_DATE();
    END $$
  • 相关阅读:
    关于checkbox的一篇博客
    如何快速学习
    for循环下的取值问题
    vue的自动更新原理
    关于word-wrap的用法;
    2016年百度面试题
    编写代码的原则
    null和defined的区别
    js的模块化加载
    springmvc注解
  • 原文地址:https://www.cnblogs.com/black-/p/8980934.html
Copyright © 2020-2023  润新知