执行存储过程循环插入数据一百万条数据时
maysql 报错 丢失连接
具体错误信息:Error Code: 2013. Lost connection to MySQL server during query 600.510 sec
存储过程如下:
CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_sample`()
BEGIN
DECLARE i int DEFAULT 0;
WHILE i<1000000 do
if i < 980000 then
insert into sample(name,imgtype,clientid,edit,time) values(i,'2','1','1','2015-05-12');
else
insert into sample(name,imgtype,clientid,edit,time) values(i,'2','1','0','2015-05-12');
end if;
set i = i + 1;
end WHILE;
END
请问这是怎么回事
在家测试没问题、单位的机器就不行了