3

Possible Duplicate:
How to split large file on Windows?

I have a 100MB SQL file which my host won't let me upload all at once (2MB per upload).

The database is on a different server so I can't use SSH. I'm stuck with phpMyAdmin.

Is there any program that can split a 100MB SQL file into 2MB chunks?

  • Voted to migrate to Superuser, as this isn't a development question. – Adam Robinson Aug 18 '11 at 13:22
  • Ohh man without ssh this going to be hard. Have you tried zipping it? I know it won't get you to 2MB but hopefully close. –  Aug 18 '11 at 13:23
  • 1
    If a zip will do, several zipping apps can split files into custom sized chunks. – MPelletier Aug 18 '11 at 13:31
  • @Mehper Might be not that trivial using SQL. – slhck Aug 18 '11 at 13:40
  • Upload your files by zipping them into multiple archives. Then, you can write a simple script using the [PHP Zip Library](http://php.net/manual/en/book.zip.php) (included by default) to unzip them. Alternatively, you could split the file on your computer (just do a binary split), and use PHP to re-join the files. – Breakthrough Aug 18 '11 at 13:52
  • 1
    Isn't an SQL file simply a text file containing a list of `create table` and `insert` statements? If so surely it is amenable to splitting at statement boundaries in a text editor or script? – RedGrittyBrick Aug 18 '11 at 14:08

1 Answers1

2

You can give this script a try, it has helped me out a couple of times:

http://www.ozerov.de/bigdump/

Altho it does not always work as expected.

DirkZz
  • 121
  • 1