Skip to main content
Importing a SQL dump is how you restore a database from a backup, migrate from another host, or stand up a copy of production for testing. phpMyAdmin’s Import tab handles dumps up to about 50 MB straight from the browser. For larger files, there’s a workaround at the bottom of this page.

Before you begin

  • The target database must already exist. Create it through Manage My Databases or Database Wizard first.
  • If the dump contains CREATE DATABASE or USE statements with the original database name, edit them out. Your prefixed name won’t match the dump’s name.
  • An empty target database is best. Importing into a non-empty one usually fails on duplicate keys.

Import a small dump (under 50 MB)

1

Pick the target database from the left tree

Click the database name. Don’t click into a specific table. The import goes at the database level.
2

Open the Import tab

Top of the page, between Export and Operations.
phpMyAdmin Import tab with file picker
3

Pick the file

Click Choose File and select your .sql, .sql.gz, or .sql.zip file. Compressed dumps are decompressed automatically.Leave Format on SQL. Leave the other options at defaults unless you have a reason to change them.
4

Click Go

The file uploads, then phpMyAdmin runs through it statement by statement. A green confirmation appears on success, with the count of queries executed.Errors stop the import and show the line number. Fix the dump and try again.

Import a large dump (over 50 MB)

phpMyAdmin’s web upload is capped to keep the front-end fast. Files larger than that need a different route.
Works on every plan.
1

Compress the dump

On your laptop, compress the .sql to .sql.gz (a 200 MB SQL file usually shrinks to 30–40 MB). On macOS or Linux: gzip yourfile.sql. On Windows: 7-Zip → “Add to archive” → .gz.If the compressed file is still over 50 MB, jump to the SSH option below.
2

Upload to the cPanel home directory

Open File Manager, go up to your home directory (the path that ends in /home/youruser), and upload the .sql.gz file.
3

Run the import from phpMyAdmin

Go back to phpMyAdmin → target database → Import tab. Scroll to File to import. There’s a second option below the upload widget called Web server upload directories with a dropdown of files in your home directory. Pick your file there.Click Go. Same outcome as a small import, but the file is read from disk on the server instead of uploaded through the browser.

Common issues

The dump contains a single statement larger than max_allowed_packet. Most often it’s a long INSERT with thousands of rows.Fix: re-export the dump with the source tool’s “extended insert” turned off, or with smaller batch sizes. In mysqldump, that’s --skip-extended-insert or --max-allowed-packet=64M. The default packet limit on Noxity hosting is 64 MB.See the MySQL reference for this error.
The target database already has rows with the same primary key as the dump. Either drop the existing tables first (Operations tab → Empty the table (TRUNCATE)) or import into a freshly-created database.
The dump was made with a newer MySQL version than the server runs. Look at the line shown. It’s almost always utf8mb4_0900_ai_ci collation or DEFINER= clauses from MySQL 8 on a MySQL 5.7 / MariaDB target.Fix: re-export with --compatible=mysql41 (mysqldump) or run search-and-replace on the dump to swap utf8mb4_0900_ai_ci for utf8mb4_unicode_ci.
Large imports can take longer than the browser is willing to wait. The server keeps running. Check the database after a few minutes and see if it’s populated. If not, use the SSH route, which doesn’t have a browser timeout.
Same root cause as “MySQL server has gone away”: a single statement is too long. Same fix.

Need a hand?