首页 > 代码库 > mysql 创建事件、存储过程

mysql 创建事件、存储过程

CREATE PROCEDURE test1 ()
BEGIN
INSERT INTO `user`(bookname) VALUES(‘asdf‘);
END;

CREATE EVENT if not exists e_test
on schedule every 30 second
on completion preserve
do call test1();

set global event_scheduler=1;
alter event e_test ON COMPLETION PRESERVE DISABLE;
alter event e_test ON COMPLETION PRESERVE ENABLE;

mysql 创建事件、存储过程