Linux, Web Server & Database
Export SQL Database
Export your MySQL/MariaDB database to a clean, usable .sql file.
The Problem
You need a full, reliable export of your database — for a migration, a developer handover, or just a point-in-time copy — and a half-finished or corrupted export causes problems later when it's actually needed.
About this problem
A database export sounds simple, but getting it reliably complete (not interrupted partway through on a large database), correctly encoded, and genuinely restorable later takes the same care as doing a proper backup — the difference is usually that an export is a one-off need for a specific purpose rather than an ongoing scheduled job.
This typically comes up when handing a database over to another developer, migrating to a new host, or just wanting a clean, verified snapshot at a specific point in time.
What's Included
- Exporting the full database (or specific tables if that's all that's needed) to a .sql file
- Ensuring the correct character set is preserved in the export
- Compressing the file for easier transfer if it's large
- Verifying the export is complete and valid, not just that the command exited
What's NOT Included
- Setting up ongoing scheduled backups (see the MySQL Database Backup service for that)
- Importing the file elsewhere (see the Import SQL Database service)
- Exporting data in a non-SQL format (CSV, JSON — separate request if needed)
How It Works
- Determine whether a full database export or specific tables are needed for the intended purpose.
- Run the export via mysqldump (or an equivalent tool for larger databases) with the correct character set flags.
- Compress the resulting file if it's large enough to benefit from it.
- Verify the file isn't truncated and opens/parses correctly as valid SQL.
- Hand over the file along with a note on how it was generated and any relevant details for whoever imports it next.
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
- What's the difference between a backup and an export?
- They use largely the same underlying process, but a backup is typically scheduled and ongoing for disaster recovery, while an export is usually a one-off copy for a specific purpose like a migration or handover.
- Can I export just specific tables instead of the whole database?
- Yes, most export tools support specifying individual tables, useful when only part of the database is relevant to the destination.
- Why does my exported SQL file show broken characters when imported elsewhere?
- Usually a character set mismatch between the export and import step — ensuring the correct charset flag is used during export avoids this.
- How large can a SQL export file get?
- It scales directly with your database size — from a few kilobytes for a tiny database to many gigabytes for large, established ones, which affects how it should be transferred and compressed.
- Is mysqldump reliable for exporting a live, actively-used database?
- With the right flags (like --single-transaction for InnoDB tables) it can produce a consistent snapshot even while the database is in active use, avoiding a maintenance window for most cases.
- Should I compress my database export file?
- For anything beyond a small database, yes — SQL text compresses very well and makes transferring or storing the file significantly faster and cheaper.