Tag et kig på Event:https://dev. mysql.com/doc/refman/5.7/en/events-syntax.html i dit tilfælde:du kan prøve denne:
-- create a timer to update this table automatically
DROP EVENT IF EXISTS `et_update_your_trigger_name`;
CREATE EVENT `et_update_your_trigger_name` ON SCHEDULE EVERY 1 MINUTE
STARTS '2010-01-01 00:00:00'
DO
DELETE FROM `DB_NAME`.`table_name` where DATEDIFF(now(),`timestamp`) > 1;
ALTER EVENT `et_update_your_trigger_name` ON COMPLETION PRESERVE ENABLE;
denne sql-kode opretter en trigger og udfører hvert minut.