Page 1 of 1

automatically truncate table daily

Posted: Tue Dec 29, 2009 10:30 am
by aalbright
Hi, I've got a question:

How would I be able to automatically truncate a mysql table at midnight every night? Is this not even possible, or really simple?

Thanks.

Re: automatically truncate table daily

Posted: Tue Dec 29, 2009 10:45 am
by Darhazer
You can use an Event if your MySQL version support this. Check out the CREATE EVENT syntax. Or you can write a script to truncate it and set it as a cron.