BEGIN
#Routine body goes here...
declare i decimal (10) default 0 ;
dd:loop
INSERT INTO `table` ( `title`, `status`, `inputtime`, `content`) VALUES ('1', '1', '1', '1');
commit;
set i = i+1;
if i= 1000000 then leave dd;
end if;
end loop dd ;
END
转载于:https://my.oschina.net/u/1260221/blog/620563