Split SQL dump files into import-ready parts.

Drop a SQL dump file (.sql) and split its INSERT statements into smaller files. The preamble (CREATE TABLE, SET, LOCK) is preserved at the top of every partial.

Drop a file here
CSV, TSV, TXT, XLSX, JSON or SQL dump
or click to browse

When do you need to split a SQL dump?

A MySQL or PostgreSQL dump that grew past a few hundred MB stops being importable in a single shot. The destination may impose a max_allowed_packet limit, the import may time out before it finishes, the hosting panel may reject anything above a fixed file size, or a connection blip mid-import may force you to start over with no way to resume. Splitting the dump into smaller import-ready parts solves all of those — each partial imports independently, you can run them in parallel, and a failure in one does not invalidate the rest.

  • Hosting panels (cPanel, Plesk) that cap phpMyAdmin imports
  • Database migrations where you need to monitor progress per chunk
  • Restoring to a new server with a strict max_allowed_packet limit
  • Sharing a sanitised dump by email with attachment size limits
  • Running ETL jobs that load one partial per worker in parallel
  • Recovering from a half-finished import without re-running everything

Why SQL dumps are hard to split manually

A SQL dump is not a CSV. It has a preamble (CREATE TABLE, SET NAMES, LOCK TABLES, ALTER TABLE … DISABLE KEYS) that must appear at the top of every import file, plus thousands of INSERT statements that need to be distributed across partials. A naive line-by-line split breaks two things at once: the preamble is missing from every partial except the first, so the schema is not defined, and an INSERT that spans multiple lines is cut in half, leaving a syntax error in two adjacent files.

MessyMatch parses the dump with a SQL-aware tokenizer that respects string literals, comments and dollar-quoted blocks. It identifies the preamble, distributes the statements across partials, and writes the preamble at the top of every partial so each file imports cleanly on its own.

How the SQL splitter works

The dump is treated as a single raw-text input — no SQL is ever executed, the parser only reads and slices the text. The tokenizer walks the file, recognising statement boundaries (semicolons that are not inside a string or comment), and classifies each statement as preamble or body. The body statements — almost always INSERTs — are distributed across the partials you asked for, by statement count, file count or target byte size. The preamble is copied to the top of every partial.

Cuts only happen between full statements. A multi-line INSERT, an extended INSERT with many tuples, or any statement that spans more than one line stays intact in the partial it lands in. If the dump contains constructs the parser cannot guarantee to split safely (procedures, triggers, functions) it refuses with a clear message instead of producing broken output.

What the splitter handles

  • Detects the preamble (CREATE TABLE, SET, LOCK statements)
  • Repeats the preamble at the top of every partial
  • Distributes INSERT statements evenly across partials
  • Splits by statement count, file count or byte size
  • Respects string literals, comments and dollar-quoted blocks
  • Refuses to split a dump that contains unsafe constructs

Honest limits

This splitter is built for the common case: a dump produced by mysqldump or pg_dump with one INSERT per statement and a standard preamble. If your dump contains stored procedures, triggers, functions, complex DDL or vendor-specific extensions, the parser flags it as too complex and refuses — splitting those safely needs a real SQL engine, not a tokenizer. The fix is usually to regenerate the dump as data-only (--no-create-info for mysqldump) and run the splitter on that.

Browser-first by design

The SQL contents are processed inside your browser via a Web Worker and are not transmitted to our servers. Our servers do not have an endpoint that ingests file contents — the Web Worker reads the file from disk, runs the split locally and hands the partials back to the browser for download. We only record metadata about the operation (row count, file size, format, elapsed time) for abuse limits. See the privacy policy for the full list.

Related tools

Frequently asked questions

What kind of SQL dumps does this support?+

Simple dumps with one INSERT per statement and a preamble that includes CREATE TABLE, SET and LOCK lines. Complex dumps with procedures, triggers or functions are not supported.

Will my SQL data be uploaded?+

No. The dump is parsed in your browser. The server never sees the SQL contents.

Will the splitter break a statement?+

Never. The parser only cuts between statements; INSERT lines and multi-line statements stay intact.

Is the preamble repeated in each partial?+

Yes. CREATE TABLE, SET and LOCK statements are copied at the top of every partial so each file imports cleanly on its own.

How big can my SQL dump be?+

Anonymous users can split dumps up to 100 MB. Free accounts can split up to 250 MB.

What if the parser flags my dump as too complex?+

It means the dump contains constructs we cannot guarantee to split safely. Export a simpler dump (data-only, one INSERT per line) and try again.