开发者

How to automatically delete old records from a database table?

There is a database table for logging purpose only so old records are useless. Is there an easy way to automatically delete old records and keep most recent rec开发者_如何学Cords only (say, records created in last 7 days, or, the latest 1 million records). The table uses MyISAM engine and have a timestamp column but do not have primary key (for fast insertion).


Set up a cron job to run a query to do so.


U can put your Logic in Insert Trigger to delete your old records

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜