MySQL Random Data Generator is a tool for developers and DBAs
to generate test data for MySQL databases. Generate SQL
INSERT statements from an existing CREATE TABLE
statement, populate a MySQL table directly, or generate test data from the
command line. It is useful for development, testing, query testing,
database migrations, replication testing, and performance testing.
This tool is for generating test data only. Never use it on production databases. Generated data is randomized and not intended to be meaningful.
Follow these steps to run the data generator manually via command line.
wget https://raw.githubusercontent.com/kedarvj/mysql-random-data-generator/refs/heads/master/populate.sql
mysql -u username -p db_name < populate.sql
Arguments: CALL populate(database_name, table_name, num_rows, 'Y/N' [debug-mode])
mysql -u username -p db_name -e "CALL populate('my_db', 'my_table', 1000, 'N')"
Generating test data is often a tedious and repetitive task for developers and DBAs. Writing custom scripts or manually creating SQL statements to fill tables can lead to errors and consume valuable development time. This tool solves that problem by providing an automated, predictable, and safe way to generate test data, allowing you to focus on building features rather than filling databases.
Paste a MySQL CREATE TABLE statement and generate randomized
SQL INSERT statements without connecting to a database.
This is useful when you need a standalone SQL file for a development,
testing, or local environment.
populate.sql procedure and execute it using the MySQL command
line client. This provides a simple way to generate repeatable test data
from scripts and development environments. Creating large amounts of test data manually can be time-consuming, especially when testing MySQL queries, applications, schema changes, migrations, or database performance. This MySQL test data generator creates randomized data based on your table structure so you can quickly populate development and test environments.
You can generate a SQL file without connecting to a database, populate an existing MySQL table directly, or use the command line for repeatable test-data generation.
Run this project on your machine using PHP and MySQL for full browser, API, and direct population support.
Follow the setup guide for prerequisites, local server commands, and database connection notes.
Inspired by the original mysql-random-data-generator project.
Open Local Hosting StepsRandomized test data can be useful in many MySQL development and database administration workflows, including:
No. This tool is strictly for test and development data. Never use it on production databases as it performs bulk insertions and generates randomized data.
No. Database credentials are only used for the current session and are never logged, stored, or transmitted to any third-party services.
Yes. Mode 1 allows you to generate SQL files entirely on your machine without requiring any database connection or permissions.
For browser stability, we apply a 100,000 row limit for SQL generation. Direct database population is batched to prevent timeouts.
If you encounter bugs or have feature requests, report it on GitHub page.
No telemetry. No tracking. Just a tool for DBAs and developers.