Linux, Web Server & Database

Import SQL Database

Import a .sql database file correctly into MySQL/MariaDB, including large files that fail through standard tools.

The Problem

You have a .sql file to import — from a backup, an export from another system, or a developer handover — but it's failing, timing out, or the standard web-based import tool can't handle its size.

About this problem

SQL file imports commonly fail for a handful of predictable reasons: the file is too large for a web-based tool's upload limit, a character set mismatch causes garbled data or an outright error, or the file references a database/table structure that conflicts with what's already there — each has a specific fix once identified correctly.

This comes up during migrations, setting up a local or staging copy from a production export, or receiving a database handover from another developer or agency.

What's Included

What's NOT Included

How It Works

  1. Check the SQL file's size and structure, and confirm which database it's intended for.
  2. Import via the MySQL command line directly, which handles far larger files than typical web-based tools without timing out.
  3. Verify the file's character set matches the target database's to prevent corrupting special characters.
  4. Watch the import process for any errors rather than assuming a completed command means full success.
  5. Spot-check table structure and row counts against expectations, then test the application against the imported data.

In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.

Frequently Asked Questions

Why does my SQL file fail to import through phpMyAdmin?
Most web-based tools have an upload size and execution time limit, and a sufficiently large .sql file exceeds one or both — importing via the command line avoids this entirely.
Can I import a SQL file into a database with a different name?
Yes, as long as the file doesn't explicitly specify a database name internally, or that reference is adjusted before import — otherwise it can try to create or target the wrong database.
What does 'Unknown character set' mean during import?
It means the SQL file specifies a character set the target MySQL/MariaDB version doesn't recognise, often because the file came from a much older or newer database version.
How long should a database import take?
It depends heavily on file size — a few megabytes imports in seconds, while gigabyte-scale files can take considerably longer, which is worth planning for if there's a downtime window involved.
Can I import a SQL file into a database that already has tables?
Yes, but if table names overlap, it can error out or overwrite existing data depending on the file's structure — worth checking for conflicts before importing into a non-empty database.
What's the safest way to import a large database file?
Command-line import, after confirming character set compatibility and ideally against an empty target database or one you've already backed up, so a failed import is easy to roll back from.
Please note: the price shown applies to a standard case matching the description above. Every situation is different, and if your request falls outside the normal scope of this service, I will explain this before doing any additional chargeable work. I will never silently turn a small job into an expensive project.
Running into an issue with a service you've already bought, or unsure which one fits your problem? Message me directly on WhatsApp — no ticket system, no bot.