What is required to run a job scheduler in mysql?

时光毁灭记忆、已成空白 提交于 2019-12-08 10:40:37

问题


I need a job scheduler to run at regular intervals, for instance every 5 hours. Which job scheduler is a good idea or are there any other techniques to run an event, for e.g. code. Would it require and additional, external software requirements.

My machine has Windows XP and working on the PHP with MySQL.


回答1:


use mysql events

from this

mysql> use test;
Database changed
mysql> create table test.t (s1 timestamp);
Query OK, 0 rows affected (0.11 sec)

14mysql> create event e on schedule every 5 hour do
       insert into test.t values (current_timestamp);
Query OK, 1 row affected (0.00 sec)

mysql> set global event_scheduler = 1;
Query OK, 0 rows affected (0.00 sec)



回答2:


SQLyog's Job Agent (SJA) is the powerful tool which includes Scheduling Database Synchronization, Schema Synchronization, Import External Data, Scheduled Back-ups, SQL scheduler & Reporting Tool(to Schedule queries). It is very easy and intuitive to use. You can try it to schedule almost all kinds of MySQL jobs.

Hope it helps and solves your purpose...



来源:https://stackoverflow.com/questions/5700522/what-is-required-to-run-a-job-scheduler-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!