SQL splitter

Paste a large MySQL SQL dump and split it into smaller importable chunks. Fixes "max_allowed_packet" errors and phpMyAdmin upload limits. Each chunk is ready to import.

⚠ This tool processes your SQL in your browser session only. For very large files (10MB+) use the command-line approach shown below.
10 - 5000 statements per file. Default 500 works for most hosts.
Why split SQL?

Import limits

phpMyAdmin has upload limits (usually 2-8MB). MySQL has max_allowed_packet limits. Large dumps with millions of rows need to be split to import without errors.

Import order

Always import part-01 first

Part 1 contains CREATE TABLE and other structure statements. Always import it first. Then import the remaining parts in numeric order.

CLI alternative

For very large files

For files over 10MB use the command line: mysql -u user -p dbname < dump.sql bypasses all upload limits entirely. Or use mysqlimport for CSV data.

Foreign keys

FOREIGN_KEY_CHECKS=0

Each chunk includes SET FOREIGN_KEY_CHECKS=0 so you can import parts out of order without foreign key constraint errors. Re-enable after all parts are imported.

Working with MySQL and PHP?

Database migrations, PDO, query optimization, and backup strategies -- covered in our PHP developer ebooks and courses.

Browse ebooks → View courses →