DROP PROCEDURE IF EXISTS proc_initData; DELIMITER $ CREATE PROCEDURE proc_initData() BEGIN DECLARE i INT DEFAULT 1; WHILE i<=5 DO INSERT INTO warning (TYPE,CODE,NAME,LEVEL,come_from) VALUES('事件','event','服务控制或应用程序','蓝','日志分析'); SET i = i+1; END WHILE; END $ CALL proc_initData();
参考 https://blog.csdn.net/CSDN2497242041/article/details/79256063