-3

I have a relatively small (MySQL) database with ~50 tables which takes about 100 MB of disk space. For my tests I would like to increase the size of the data to 100-1000 GB keeping the same schema (tables, keys, indexes). What would be the best way/tool to populate this database with additional data (pseudorandom with respect to existing data) ?

Hopefully the question makes sense.

  • possible duplicate of [Tools for Generating Mock Data?](http://stackoverflow.com/questions/591892/tools-for-generating-mock-data) – Bill Karwin Jan 23 '14 at 16:23

2 Answers2

1

The best way would be to build php program that would connect to mysql and loop on insert to insert dummy data into the database

like

<?php

$con=mysqli_connect("example.com","peter","abc123","my_db");

// Check connection
if (mysqli_connect_errno()){
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

for ($i = 1; $i <= 10; $i++) {
   mysqli_query($con,"INSERT INTO Persons (FirstName, LastName, Age) VALUES ('Peter', 'Griffin',35)");
} 
Danny620
  • 5
  • 4
0

you can adapt this program that fetches fake data from the internet and populate tables (provided that the columns it has will fit your needs). Check it out here if you want.

enter image description here

Adriano_Pinaffo
  • 1,429
  • 4
  • 23
  • 46