Economicalhost · Knowledge Base
Knowledge Base › Databases › How to Import and Export a MySQL Database
Databases

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

  1. Export: open phpMyAdmin → select the database → Export tab.
  2. Quick + SQL format → Go. The browser downloads dbname.sql. For a smaller file, choose Custom → Compression: gzipped.
  3. Import: select the destination database (create it first via the wizard if needed) → Import tab.
  4. Choose the .sql or .sql.gz file → Go. Success shows a green confirmation listing the queries executed.
  5. 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.
  6. "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.
  7. 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.