Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Creating large test database
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jpc82
Guru
Guru


Joined: 09 Mar 2003
Posts: 326

PostPosted: Wed Jul 07, 2004 3:24 pm    Post subject: Creating large test database Reply with quote

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
View user's profile Send private message
nevynxxx
Veteran
Veteran


Joined: 12 Nov 2003
Posts: 1123
Location: Manchester - UK

PostPosted: Wed Jul 07, 2004 3:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
beowulf918
Tux's lil' helper
Tux's lil' helper


Joined: 03 Dec 2002
Posts: 147
Location: The Gambia

PostPosted: Wed Jul 07, 2004 3:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
nevynxxx
Veteran
Veteran


Joined: 12 Nov 2003
Posts: 1123
Location: Manchester - UK

PostPosted: Wed Jul 07, 2004 4:00 pm    Post subject: Reply with quote

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! :twisted:

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
View user's profile Send private message
jpc82
Guru
Guru


Joined: 09 Mar 2003
Posts: 326

PostPosted: Thu Jul 08, 2004 1:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum