- CREATE TABLE `single_table` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `name` VARCHAR(50) DEFAULT NULL,
- `post` TEXT,
- PRIMARY KEY (`id`)
- ) ENGINE=MYISAM DEFAULT CHARSET=utf8;
1 DELIMITER $$
2
3 USE `bigdata`$$
4
5 DROP PROCEDURE IF EXISTS `insert_single_table`$$
6
7 CREATE DEFINER=`root`@`localhost` PROCEDURE `insert_single_table`(IN item INTEGER)
8 BEGIN
9 DECLARE counter INT;
10 SET counter = item;
11 WHILE counter >= 1 DO
12 INSERT INTO single_table VALUES(counter,CONCAT('mysqlsystems.com',counter),REPEAT('bla',counter%10));
13 SET counter = counter - 1;
14 END WHILE;
15 END$$
16
17 DELIMITER ;
CALL `insert_single_table`(5000)