문제

I am looking for a way to automatically clean table in MySQL once per day. Is this possible without using cron? The best solution would be a trigger, but any solution is applicable.

도움이 되었습니까?

해결책

One option is MySQL's EVENT scheduler:

CREATE EVENT e_daily
    ON SCHEDULE
        EVERY 1 DAY
        STARTS '2014-02-23 05:00:00' -- Time to start
    COMMENT 'Descriptive comment'
    DO
        TRUNCATE yourtable;

How to enable event scheduler

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top