DELIMITER $$
USE `caicai`$$
DROP PROCEDURE IF EXISTS `test`$$
CREATE DEFINER=`root`@`%` PROCEDURE `test`()
BEGIN
DECLARE i INT;
SET i = 0;
WHILE i < 100000 DO
SET @s =" INSERT INTO c2 SET plan_id = 2, user_name = 'lzj', user_id=1, is_show=1,
content='像我们这样的国家的人人不人不人不档不档档档档档洒洒洒洒洒洒档档澡中中中中国可园是中',
ip_addr = 'lanj',
ip = '12.12.1.1',
add_time = '130888888' ";
PREPARE stmt FROM @s;
EXECUTE stmt;
SET i = i + 1;
END WHILE;
END$$
DELIMITER ;
非常简单的插入,也需要47秒。。。