mysql 循环插入100w

use md5db;


DROP PROCEDURE if exists myFunction;


delimiter $$


CREATE PROCEDURE myFunction()

    BEGIN

        DECLARE i INT DEFAULT 0;

        WHILE (i<1000001) DO

            INSERT INTO `md5`(`MD5_TXT`, `MD5_HASH`) VALUES (i,md5(i));

            SET i=i+1;

        END WHILE;

    END$$


delimiter ;

call myFunction();

posted @ 2016-04-01 17:27  托马斯布莱克  阅读(385)  评论(0编辑  收藏  举报