CREATE EVENT database_clean ON SCHEDULE EVERY 1 HOUR DO BEGIN -- INSERT INTO mytable (col1) VALUES ('value'); DELETE FROM so_api_inst WHERE CREATE_TIME < NOW() - INTERVAL 7 DAY; END
show events;
SELECT EVENT_SCHEMA as '数据库', EVENT_NAME as '事件名', DEFINER, EVENT_TYPE as '事件类型', EXECUTE_AT as '执行时间', INTERVAL_VALUE as '间隔值', INTERVAL_FIELD as '间隔字段', LAST_EXECUTED as '上次执行时间', STARTS as '开始时间', ENDS as '结束时间', STATUS as '状态', EVENT_DEFINITION as '事件定义' FROM information_schema.EVENTS;
DROP EVENT IF EXISTS database_clean;
上一篇:MySQL创建数据库并赋予权限
下一篇:mysql数据库调优
git commit 时报错:husky - pre-commit hook exited with code 1 (error)
2023-10-28