具有特定时间的mysql事件
我正在使用托管公司的 mysql。他们给了我 50 MB 最大存储空间用于 mysql。我的 mysql 中有一个表增长得非常快。如果我以不同的格式将此表保存到我的服务器并清理表中的新条目,我不会遇到任何存储问题。
我的问题是,有没有办法为服务器设置超时?我的意思是,如果服务器有一种方法可以在特定时间启动某个功能。
假设我希望我的服务器在 2012 年 1 月 15 日启动一项功能。我可以这样做吗?就像有没有办法设置服务器来启动我的功能?我可以编写一个 php 函数来保存我的 mysql 表并清理它吗?
I'm using mysql from a hosting company. They give me 50 mb max storage for mysql. And There is a table which grows very fast in my mysql. If I save this table in different format to my server and clean my table for new entries I don't have any storage problems.
My question is, is there a way to set a timeout for server to do it? I mean like if there is a way from server to start a function on a specific time.
Let's say I want my server to start a function at 01.15.2012.. Can I do that? Like is there a way to set server to start my function? and can I write a php function to save my mysql table and clean it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果它是 Linux 服务器,您可以使用 cron。编写 php 脚本,然后设置 cron 进程以在特定时间执行该脚本。
If it's a Linux server you can use cron. Write your php script, then set up the cron process to execute the script at a particular time.
您可以使用MySQL事件来运行脚本或调用存储的功能。
You can use MySQL events to run a script or to call stored function.