SQL dump splitter
Choose a dump and a size. The file is cut between statements, never inside one, and nothing is uploaded.
The file is read by your browser and is not uploaded.
When splitting helps
An import page has a limit, usually set by upload_max_filesize and post_max_size, and a shared host may not let you raise either one. Splitting the dump gets it through in pieces. If you have a shell on the server, you do not need this page: the command line client reads a file of any size.
mysql -u app -p app_db < dump.sqlThe limits themselves, and how to raise them, are in the upload_max_filesize error.
What the splitter does
It reads the file as text and walks through it the way the mysql client does. A semicolon inside quotes, inside backticks or inside a comment is not the end of a statement. A DELIMITER line changes the end marker until the next one, so triggers and procedures stay whole.
A dump from mysqldump opens with a few SET statements that choose the character set and switch off foreign key checks for the connection. Each part you import is a new connection, so every part after the first starts with those lines again. The same goes for a USE line at the top.
A part can come out larger than the limit in one case: a single INSERT that is larger than the limit by itself. The page says so when it happens. Make the dump again with smaller statements, using options from the mysqldump manual: --skip-extended-insert writes one row per INSERT, and a lower --net-buffer-length makes the multi-row statements shorter.
Importing the parts
Import them in the order of their numbers. The table definitions come before their rows, and a part that fails leaves the earlier ones in place, so read the error before you go on with the next number.
Two kinds of dump need care. One made with --single-transaction is consistent as a whole, but once it is cut, the import is not one transaction. And when views depend on tables from a later part, they work only after the last part is in.
How it was tested
The tests run dumps with quoted semicolons, escaped quotes, comments, versioned comments and trigger bodies through the splitter. Joined together, the parts must hold the same statements in the same order. More about making dumps that are easy to load is in mysqldump examples.
PHPSolvedThe fix first, then the reason