如何在特定日期和时间启动Mysql触发器 [英] how to fire a Mysql trigger on an specific date and time

查看:546
本文介绍了如何在特定日期和时间启动Mysql触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在每个月底调用一个商店程序,我只需要知道如何在特定的日期和时间触发触发器来调用我的存储过程。


$ b $谢谢你的时间。

解决方案


MySQL不能这样做。相反,您应该使用 cronjob 。如果您使用的是Linux系统,则可以创建运行存储过程的脚本或程序,并使用 crontab 命令进行安排。



在命令行中,编写 crontab -e 将允许您编辑您的cronjobs。在这里,您可以添加

  0 5 L *? * /path/to/script.pl 

这将运行 / path /到/ script.pl 在上午5点,每个月的最后一天。


I have to call a store procedure at the end of each month, i just need to know how to fire a trigger on an specific date and time to call my stored procedure.

Thanks for your time.

解决方案

MySQL can't do this. Instead, you should use a cronjob. If you're on a Linux system, you can create a script or program that runs your stored procedure and schedule it for execution using the crontab command.

In the command line, writing crontab -e will allow you to edit your cronjobs. In here, you can add

0 5 L * ? * /path/to/script.pl

This will run /path/to/script.pl at 5 AM, the last day of every month.

这篇关于如何在特定日期和时间启动Mysql触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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