We all had fun with the World Database, Sakila and the others when learning MySQL (see Example Databases), but it sometimes isn’t enough to run certain experiments, benchmarks within your own schema. Of course you could write a script that would generate junk data based on your column types and populate your database with a few thousand entries, but as it turns out, Benjamin Keen already did.
Meet Generate Data – a free and open source script written in php, generates quality data for your databases. Works with MySQL and, well, pretty much with any SQL compliant database I guess. What I liked about Generate Data is that you get to pick your columns, their types, and the sample data like names, last names, integer between two values, lorem ipsum (my favorite) and a bunch of others. This is why I said “quality data”.
There are a few issues I encountered, like trying to get 5000 rows gave me only 200, but such issues could easily be solved by downloading the source code and launching it locally with a few fixing (I wonder why Benjamin did such a bad job at documenting the whole thing). It took me a few minutes to fill up 30,000 rows of sample data, so who needs the World database anyway?
The script is being updated from time to time and new features are being added, not too fast, but they are. Let’s see where Benjamin takes this by the end of this year ;)
[…] This post was mentioned on Twitter by Konstantin Kovshenin, Amor. Amor said: How to Generate Quality Data for MySQL http://bit.ly/cqghX8 – via @kovshenin […]
At this very moment, that website is broken. What about uploading the script somewhere else?
Works for me. You can also try out Benjamin's HTML 5 demo here: http://beta.generatedata.com/
For reasons beyond me, I had entries in the host file that blocked JavaScript on that website.
Temporarily trimmed it down (it was 16,200 lines), flushed the DNS cache and reloaded the page.
Now it works.
My fault.
While this isn't what I was looking for right now, I like the look of it and have bookmarked it for future reference