写一段mysql 创建定时任务的代码 定时任务没分钟执行一次,过程是执行存储过程 sp_clear_author
时间: 2024-05-14 20:19:30 浏览: 59
mysql 让一个存储过程定时作业的代码
Sure, here's an example of MySQL code to create a scheduled task that executes a stored procedure every minute:
```
CREATE DEFINER=`root`@`localhost` EVENT `my_event`
ON SCHEDULE EVERY 1 MINUTE
DO CALL sp_clear_author();
```
This code will create a new event named "my_event" that is scheduled to run every minute. The command to be executed is `CALL sp_clear_author();`, which will execute the stored procedure named "sp_clear_author". You can customize the name and schedule of the event to suit your needs.
阅读全文