Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Importing data to MySQL
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
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Sat Aug 21, 2004 6:59 pm    Post subject: Importing data to MySQL Reply with quote

Scenario: Moving to a new web host with a limited amount of space (50 megs).

My database dump file is 48 megs. It's too big for me to upload; I get a Quota Exceeded error.

Zipped, the database is 11 megs and my web host doesn't count DB space against my total space used.

What I need to learn is how to insert the data from the sqldump.zip file into the database without unzipping the file to disk. I'm not quite sure how this should be done. I've got a couple ideas, but none seem to be panning out.

mysql –uUSERNAME –p NEWDBNAME < `unzip sqldump.zip`

I've been trying different things like this, but my scripting skills suck. I need a push in the right direction.
_________________
http://get.a.clue.de
Back to top
View user's profile Send private message
dcoyaz
n00b
n00b


Joined: 09 Mar 2004
Posts: 10
Location: Arizona

PostPosted: Sat Aug 21, 2004 7:35 pm    Post subject: Reply with quote

using gzip you could do the following, i think unzip has a pipe output as well but i haven't tried.

gzip -c -d yourzipfile | mysql -u root -p databasename

hth,
general disclaimors :P
Back to top
View user's profile Send private message
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Sat Aug 21, 2004 9:36 pm    Post subject: Reply with quote

Thank you! =)
_________________
http://get.a.clue.de
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