Skip to content

Instantly share code, notes, and snippets.

@Rankarusu
Created July 9, 2025 08:56
Show Gist options
  • Save Rankarusu/b3876829adb625344949e17ea1ad05f6 to your computer and use it in GitHub Desktop.
Save Rankarusu/b3876829adb625344949e17ea1ad05f6 to your computer and use it in GitHub Desktop.
Generate lots of data in MySQL
drop procedure if exists doWhile;
SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;
DELIMITER //
CREATE PROCEDURE doWhile()
BEGIN
DECLARE i INT default 1;
WHILE (i <= 15000000) DO
INSERT INTO table VALUES (...);
SET i = i+1;
END WHILE;
END;
//
CALL doWhile();
SET autocommit=1;
SET unique_checks=1;
SET foreign_key_checks=1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment