zoukankan      html  css  js  c++  java
  • 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 $$
  • 相关阅读:
    【Maven】安装配置、目录结构、配置文件、常见命令
    【Maven】基础概念、仓库、构建与部属
    【float】与【position】汇总
    【CSS】定义元素的对齐方式
    【CSS】元素样式
    【CSS】绝对定位和相对定位
    网页常见布局
    php--常用的时间处理函数
    16位cpu下主引导扇区及用户程序的编写
    浅谈pageobject模式
  • 原文地址:https://www.cnblogs.com/black-/p/8980934.html
Copyright © 2011-2022 走看看