View previous topic :: View next topic |
Author |
Message |
jpc82 Guru
Joined: 09 Mar 2003 Posts: 326
|
Posted: Wed Jul 07, 2004 3:24 pm Post subject: Creating large test database |
|
|
I need to create a very large database to test my webpage however I'm not sure what si the best way to do this since I have never really used mysql before.
I was thinking the best way would be to dump the db using mysqldump, and then edit (using a shell script) that file by adding more inserts, then importing it back in (once I learn how to import).
Does this sound like a good idea? |
|
Back to top |
|
|
nevynxxx Veteran
Joined: 12 Nov 2003 Posts: 1123 Location: Manchester - UK
|
Posted: Wed Jul 07, 2004 3:36 pm Post subject: |
|
|
Pick a language, put a for loop in it that goes up to a high number, and have it dump insert statements to a file. Then import them into the database.
Another good one would be to ls over your mp3 collection, forming the results into insert statments. Depends what you call a big database. _________________ My Public Key
Wanted: Instructor in the art of Bowyery |
|
Back to top |
|
|
beowulf918 Tux's lil' helper
Joined: 03 Dec 2002 Posts: 147 Location: The Gambia
|
Posted: Wed Jul 07, 2004 3:41 pm Post subject: |
|
|
You could, but you would end up with a mostly useless 10k line text file. If you've done anything with perl, I suggest using the DBI perl module to do the dirty work for you.
By the way, a dump can be restored with
Code: |
mysql DBNAME < DUMPFILE
|
James |
|
Back to top |
|
|
nevynxxx Veteran
Joined: 12 Nov 2003 Posts: 1123 Location: Manchester - UK
|
Posted: Wed Jul 07, 2004 4:00 pm Post subject: |
|
|
Well since the object is to create a mostly useless god-knows-how-many-record databse, I assumed the redundant, and highly delete able text file would be not considered a problem!
I would mostly go for the ls approch though, 1 line of bash to create a text file, drop that into sql, delete the text file, then you have a big (probably) database, and a nice way of searching out your music later.
Ohhh actually if you go the script route you could no doubt open each mp3 (or ogg) file to grab tag info and make it a really nice database.... _________________ My Public Key
Wanted: Instructor in the art of Bowyery |
|
Back to top |
|
|
jpc82 Guru
Joined: 09 Mar 2003 Posts: 326
|
Posted: Thu Jul 08, 2004 1:45 am Post subject: |
|
|
Thanks for all the help,
I create a shell script which read a very large file full of name (22000+) and created records based on the names, and everything went fine. Soon I will be testing it out with a much larger db. |
|
Back to top |
|
|
|