模拟表结构如下,可以自行添加字段,insert语句自行调整
执行如下语句,耐心等待
drop procedure if exists my_procedure;
delimiter $
create procedure my_procedure()
begin
DECLARE num INT;
SET num = 1;
WHILE num < 100000 DO
INSERT INTO t_test (id,name,ip)
VALUES
(
num,
num,
'192.168.1.1'
);
SET num = num + 1;
end while;
end $
CALL my_procedure();
执行界面如下
整体速度不快,等待插入数据完毕,可以模拟做下查询测试