March 27, 2009
Problem Restoring Big SQL File ?
Have you ever got a problem with importing big files? For example restoring sql file to phpMyAdmin? I have experienced that once, when i tried to make a hosting migration for our forum. They said the file imported couldn’t be more than 2mb, then how to restore my sql file which was around 25mb at that time? Copy paste the code one by one? huh?! Not recomended, it would take so much time though.
I came up with the solution by writing simple file splitter codes on vfp.
here’s the code :
-
** Simple File Splitter (c) 2009 - !CrazyDavinci! (http://crazydavinci.net) **
Local cFile,nSize,nByte,cString
cFile = Fopen("forum.sql") && Change this with the filename
nSize = Fseek(cFile, 0, 2)
nByte = 1900000 && Change this with max number of file size in bytes
Fseek(cFile, 0, 0)
For i = 1 To nSize/nByte+1cString = Fread(cFile, nByte)
Strtofile(cString,"split_"+Allt(Str(i))+".sql")Next
Fclose(cFile)
Simple, isn’t it?
This will create multiple files like “split_1.sql”, “split_2.sql” and so on.
All you have to do next is modifying the content of the file, so the sql command wont be broken on the wrong line, make the approriate editing between one file to another, check the first and the end of the file, then you are ready to import the files one by one.







Media-Box
March 28th, 2009 at 5:56 PM
coolllllllllllllllllllllllllllllllllllll
ajib
April 1st, 2009 at 10:32 PM
Xixixixi…
Om jOy in ActioniX …
wakakakkekeke …
May 19th, 2010 at 2:48 AM
hi there, i just found your site listed on google, and i would like to comment that you compose awesomely good via your site. i am truly struck by the mode that you write, and the content is outstanding. anyway, i would also love to acknowledge whether you would like to exchange links with my site? i will be to the great extent than happy to reciprocate and put your link off in the blogroll. anticipating for your response, i would like to convey my appreciation and have a great day!