如何在预定义的固定时间运行MYSQL查询? [英] How to run a MYSQL query on a pre-defined fixed time?

查看:72
本文介绍了如何在预定义的固定时间运行MYSQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Mysql插入查询.我需要每天11:00 AM运行查询.

I have a Mysql insert query. I need to run the query everyday, at 11:00 AM.

如何在固定时间在MySQL中执行查询?
在MS-SQL中,我可以通过SQL Server代理作业计划程序轻松地做到这一点.那么,有什么方法可以在My-SQL中运行预定义的计划查询?我的MySQL版本是:5.5.12.

How do I execute a query on a fixed time in MySQL?
In MS-SQL i can easily do it by SQL Server agent job scheduler. So, is there any way to run a predefined schedule query in My-SQL? My MySQL version is: 5.5.12.

推荐答案

您可以使用事件调度程序在Mysql中实现上述目的.

You can use the event scheduler to achieve the above purpose in Mysql.

要创建事件,可以使用create event语句. 此处是示例的解释.

To create an event, you can use the create event statement. Here is an explanation with example.

类似这样的东西:

CREATE EVENT e_totals
->     ON SCHEDULE AT '2006-02-10 23:59:00'
->     DO INSERT INTO test.totals VALUES (NOW());

这篇关于如何在预定义的固定时间运行MYSQL查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆