Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
How to open a big .sql file?
Old 01-05-2007, 11:37 PM How to open a big .sql file?
Novice Talker

Posts: 6
Name: CrossX
Location: Albania :)
Trades: 0
Hi !

I have a sql file around 200 MB... and i want to open it?

im trying with all text editor but is imposible to open!

some one now a way to open that file

thank you
__________________
Proud to be Albanian ^__^
CrossoverX is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-06-2007, 06:51 AM Re: How to open a big .sql file?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
In my memory, it's a real pain.

Last time I had to do so on a 1.5 Go file, I've created an PHP script to do it for me, reading the file line after line, and creating a new file with just the modified lines.

Otherwise, try to use an Hex editor.
As far as I know, the load only a small part of the file in memory.
But, the cannot expand a file, ie: you can only replace characters, not add them.

Or, the last solution, and maybe the easiest:
Import your sql file in a temporary database, make the modifications you need on the datas, and dump the temporary database again.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-06-2007, 05:34 PM Re: How to open a big .sql file?
Novice Talker

Posts: 6
Name: CrossX
Location: Albania :)
Trades: 0
ok ... i understand

i was thinking that was some slq studio soft for this big files.

thank's
__________________
Proud to be Albanian ^__^
CrossoverX is offline
Reply With Quote
View Public Profile
 
Old 01-10-2007, 07:08 PM Re: How to open a big .sql file?
PolarWeb's Avatar
Average Talker

Posts: 23
Trades: 0
With linux shell (over ssh for example) you can easilly chop it in pieces with for example following command:

Lets assume your sql file is example.sql. With this command the sql file will be choped to 50m pieces. CD to the directory where the sql file is located and execute following command:

split -b 50m example.sql example_

You will get files example_aa , example_ab and so on.

now you can open any of those files, edit and save. When you are done you can combine those files with a command like for example:

cat example_[aa-bb] > example.sql
__________________


Please login or register to view this content. Registration is FREE
!

Last edited by PolarWeb; 01-10-2007 at 07:09 PM..
PolarWeb is offline
Reply With Quote
View Public Profile
 
Old 01-10-2007, 07:34 PM Re: How to open a big .sql file?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Hoooo, I never knew about that one...

Thanks a lot, it will totally help me in any future case like that.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to How to open a big .sql file?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32144 seconds with 12 queries