How to Import and Export a MySQL Database
Exports are your database backups and your migration vehicle. Imports bring a dump back to life. phpMyAdmin handles both for typical site databases.
Step-by-step
- Export: open phpMyAdmin → select the database → Export tab.
- Quick + SQL format → Go. The browser downloads dbname.sql. For a smaller file, choose Custom → Compression: gzipped.
- Import: select the destination database (create it first via the wizard if needed) → Import tab.
- Choose the .sql or .sql.gz file → Go. Success shows a green confirmation listing the queries executed.
- If the dump is larger than the upload limit (shown on the Import page), zip it as .sql.gz; if still too large, contact EconomicalHost support to import it server-side for you.
- "Table already exists" errors: either drop the old tables first (database → Check All → Drop) or re-export with "Add DROP TABLE" enabled in Custom export.
- After importing for a migrated site, update the application's config file with the new database name/user (the prefix differs between accounts).
💡 Good to know
- Exports taken at 2 am by cron are great, but manual pre-change exports are the habit that prevents disasters.
- Character-set garbles (???? in text) come from mismatched collation — export and import both as utf8mb4.
- A .sql file is plain text — you can open it in an editor to confirm what is inside before importing.