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 :)
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
 
When You Register, These Ads Go Away!
Old 01-06-2007, 06:51 AM Re: How to open a big .sql file?
tripy's Avatar
Fetchez la vache!

Posts: 2,171
Name: Thierry
Location: In the void
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
 
Old 01-06-2007, 05:34 PM Re: How to open a big .sql file?
Novice Talker

Posts: 6
Name: CrossX
Location: Albania :)
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
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

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
Fetchez la vache!

Posts: 2,171
Name: Thierry
Location: In the void
Hoooo, I never knew about that one...

Thanks a lot, it will totally help me in any future case like that.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to open a big .sql file?
 

Thread Tools

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

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


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


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

 


Page generated in 0.14510 seconds with 12 queries