Skip to content
Free tool

SQL Splitter: Split and compress an SQL file

Is your SQL file too large to import into phpMyAdmin? The SQL Splitter compresses it as .sql.gz or splits it between complete statements into parts under 1.9 MB, such as community-db.sql at 98 KB in 20 KB as .sql.gz. Free, no sign-up or upload required: your file stays in your browser.

Built by Justin Schuessler

On your own VPS, you can import large dumps through the console without phpMyAdmin's upload limit.

Your file stays in your browser: it is neither uploaded nor stored.

Example result

How the SQL Splitter splits a dump

First, the tool checks whether the compressed file is already under your limit. If not, it splits the dump between complete statements and includes the dump header in every part. This example uses a small mysqldump with a target size of 40 KB to produce multiple parts; your results depend on your file.

Example · Input: community-db.sql, 98 KB, 56 statements, 2 tables, trigger, procedure and view

SQL file
98 KB
As .sql.gz
20 KB
4.9 times smaller
Parts under 40 KB
3
Import issues found
9
DEFINER, CREATE DATABASE/USE, MySQL 8 collation
Parts in import order
community-db-part-001.sql     28 KB   17 Statements  players, scorescommunity-db-part-002.sql     40 KB    3 Statements  scorescommunity-db-part-003.sql     32 KB   18 Statements  scores

Why this tool

An SQL Splitter that produces importable parts

Many splitters cut by line or megabyte, breaking triggers, procedures or records. This one reads the dump like the mysql client.

Compress first, then split

SQL dumps contain a lot of repeated text and are often many times smaller as .sql.gz files. phpMyAdmin can import them directly. The tool calculates the compressed size first. If it fits within your limit, you don't need to split the file.

Split only between complete statements

The parser recognizes strings with escapes, --, # and /* */ comments, mysqldump's /*!40101 … */ lines and DELIMITER blocks. A semicolon inside a string or DELIMITER block does not split a statement.

Large INSERTs are split between rows

If an INSERT with many rows exceeds the part size, it is split into multiple INSERTs with the same header, always between records. If a single record is too large on its own, the tool reports its number and table.

Each part can be imported separately

Character set, SQL mode, time zone and foreign key settings from the dump header are included in every part, and all settings are restored at the end. The active USE and DELIMITER are carried over too.

Optional import fixes

DEFINER, CREATE DATABASE and USE, MySQL 8 collations, and replication lines: the tool shows how often they occur and only changes what you select. You can also apply the fixes without splitting.

Runs in your browser, even with hundreds of MB

Dumps often contain customer data. The file is streamed in a Web Worker and never leaves your computer. You can track progress and cancel without the tab freezing.

How it works

Import a large SQL file in three steps

From an oversized dump to a ready-to-use database, with no account or upload.

Step 1

Load SQL file

Drag a .sql, .sql.gz, or .zip file into the box. The tool reads it in your browser, counts statements and tables, and checks for common import issues.

Step 2

Compress or split

Choose an upload limit: phpMyAdmin 2 MB, 8 MB, or a custom value. If the .sql.gz file fits, you can download it as a single file. Otherwise, the tool splits it into chunks below the target size (at most 1.9 MB for 2 MB), available individually or as a ZIP, with optional import fixes.

Step 3

Import into phpMyAdmin

Select the database on the left, open the Import tab, choose the file and click OK. For multiple parts, import them one after another, starting with part 1. Or copy a part and paste it into the SQL tab.

Error messages

Why imports fail in phpMyAdmin and how to fix them

The most common messages when importing an SQL file and what to do in the tool.

Import hangs at “Please be patient, the file is being processed.”

Cause: The file exceeds phpMyAdmin's upload limit (2 MB on our servers, shown as “Maximum size: 2,048 KiB”). phpMyAdmin 5.2 often shows no error; the loading indicator just keeps spinning. Depending on the server settings, you may instead see “No data was received to import”.

Solution: Upload it as .sql.gz. If it is still too large, split it and import the parts one after another.

“It seems that the connection to the server has been lost” in the SQL tab

Cause: The pasted text is too large. The browser sends it encoded: spaces and special characters count three times, and line breaks six times. That means 1.9 MB of text can quickly exceed 2 MB.

Solution: Choose “Paste into SQL console” in the tool so the parts stay under the limit even when encoded.

#1227 Access denied; you need (at least one of) the SUPER privilege(s)

Cause: Views, triggers or procedures have a DEFINER set to a user from the old server. MariaDB calls this privilege SET USER; SQL_LOG_BIN in MySQL dumps requires BINLOG ADMIN.

Solution: Select the “Remove DEFINER” fix and, for MySQL dumps, “Remove replication lines”.

#1273 Unknown collation: 'utf8mb4_0900_ai_ci'

Cause: The dump comes from MySQL 8. MariaDB does not support this collation, even in version 11.6.

Solution: Select the “Replace MySQL 8 collations” fix.

#1193 Unknown system variable 'GTID_PURGED'

Cause: The dump comes from a MySQL server with GTID replication. This line is specific to MySQL.

Solution: Select the “Remove replication lines” fix.

#1044 Access denied for user … to database …

Cause: The dump creates its own database with CREATE DATABASE or switches with USE to one your user cannot access.

Solution: Select the “Remove CREATE DATABASE and USE” fix, and first select the correct database on the left.

#1452 Cannot add or update a child row: a foreign key constraint fails

Cause: A part inserts data whose related rows only arrive in a later part.

Solution: The tool disables foreign key checks in each part. You still need to import the parts in order.

#1050 Table already exists or #1062 Duplicate entry

Cause: A part was imported twice, often after an import was interrupted.

Solution: Don't start over: resume with the part that failed. If you're unsure, empty the database and start again.

The right approach

Compress, split or use another tool?

Splitting is not always the best option. Here's how to decide in a minute.

Path 1

Compress (.sql.gz)

The fastest option when the compressed file is under the limit: one file, one import, no changes.

Path 2

Split with this SQL Splitter

When even the .sql.gz is too large and you only have phpMyAdmin. It takes multiple uploads but no additional software.

Path 3

HeidiSQL or another database client

For very large dumps or individual records over the limit. The client connects directly to the database, so there is no upload limit. On Windows: File, Run SQL file.

Path 4

mysql client in the console

If you have a VPS or SSH access, mysql -u benutzer -p datenbank < dump.sql imports without phpMyAdmin's upload limit; use zcat for a .gz file.

Discover more

More tools

FAQ

Frequently asked questions

Quick answers about phpMyAdmin imports, SQL dumps, and this SQL Splitter.

Either one .sql.gz that phpMyAdmin can import directly, or multiple .sql files, each under your limit. The parts are available individually and as a ZIP, optionally also as .sql.gz and as text to copy. community-db.sql (98 KB) becomes 20 KB as .sql.gz, or 3 parts when split at a target size of 40 KB. Each part includes the dump header and is listed in import order. The tool also shows each part's size, statements and tables.

phpMyAdmin receives files through PHP, which limits upload size (upload_max_filesize and post_max_size). On our database servers, the limit is 2 MB; phpMyAdmin displays this under Import as “Maximum size: 2,048 KiB”. Text you paste into the SQL tab is subject to the same limit. That's why the tool has a “Paste into SQL console” mode: it calculates the size the browser actually sends and makes the chunks smaller accordingly.

Often, yes. The limit applies to the uploaded file—the compressed one—and SQL dumps contain a lot of repeated text. phpMyAdmin decompresses a .sql.gz file itself during import. The SQL Splitter calculates the .sql.gz size first, shows you how much smaller it is, and recommends splitting only if the compressed file still exceeds your limit.

Load a .sql, .sql.gz or .zip file into the SQL Splitter, such as an export from mysqldump, mariadb-dump, phpMyAdmin, HeidiSQL or Adminer. It splits only between complete statements: the tool recognizes strings with escapes, comments, /*!…*/ lines and DELIMITER blocks for triggers and procedures, so semicolons inside them do not cause a split. If a multi-row INSERT is larger than one part, it is divided between records into multiple INSERTs with the same statement header. If a single record exceeds the target size, usually an image in a BLOB column, the tool identifies the statement number, line and table. Import that part with HeidiSQL or the mysql client, or try uploading it as .sql.gz.

Import the numbered parts in order, starting with part 1, all into the same database. Part 1 usually contains the CREATE TABLE statements; later parts populate the tables. If the dump has foreign keys, each part disables foreign key checks at the start and re-enables them at the end. If a part fails, fix the error and resume with that same part. Do not import earlier parts again, or you'll get “Table already exists” or “Duplicate entry”. If you're unsure what's already been imported, empty the database (in phpMyAdmin, select and drop all tables on the Structure tab) and start again with part 1.

Views, triggers, procedures, and events store the user account they run under (DEFINER). If that account belongs to the old server, such as root, your database user cannot create them. Select “Remove DEFINER” in the tool, and the server will create them under your user account. MariaDB calls the missing privilege SET USER. If the dump comes from MySQL, the SQL_LOG_BIN (BINLOG ADMIN privilege) and GTID_PURGED lines may also fail; use “Remove replication lines” for those.

utf8mb4_0900_ai_ci is the default collation in MySQL 8. MariaDB doesn't support it, even in version 11.6, and stops at CREATE TABLE with error #1273. The “Replace MySQL 8 collations” fix replaces it and the other 0900 variants with utf8mb4_unicode_ci, and the case-sensitive variants with utf8mb4_bin. It leaves INSERT statements—and therefore your data—unchanged.

No. Dumps often contain customer data and credentials, so the tool reads the file only in your browser, in a Web Worker. There is no upload, storage, or account. In the developer tools’ Network tab, you can see that compressing and splitting sends no request containing your file.

Any more questions?

Contact Support
Larger databases?

Your database without an upload limit on your own VPS

With a ZAP-Hosting VPS, you have root access, can import large dumps through the console and can run MySQL, MariaDB or PostgreSQL however you want.

4.4/5 Trustpilot32,000+ Active serversSince 2010

No setup. No risk. Online in seconds.

Flexible TermCancel anytimeOnline in 60 seconds

Looking for more tools? View all developer tools