Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Export and Import a MySQL Database with phpMyAdmin

Learn to save your database to a file and to load a file back into a database.

Databases2 min read12 steps9 screenshots

What are export and import?

A database is where your website keeps its data. Export means saving a copy of it into a file. Import means reading a file back into a database. An export is also a backup. You can use it to move a site to a new place.

phpMyAdmin is a web tool that does both jobs with a few clicks. The file usually ends in .sql.

Export a database

  1. Log in to your control panel and open phpMyAdmin.
  2. Click your database name on the left.
    Screenshot: Click your database name on the left.
    Screenshot: Click your database name on the left.
  3. Click the Export tab.
    Screenshot: Click the Export tab.
  4. Choose Quick to export everything with default settings.
  5. Make sure the format says SQL.
  6. Click Go.

Your browser downloads the file. Keep it safe.

Tip: Pick Custom if you want only some tables, or want to compress the file with zip or gzip.

Import a database

Warning: Importing can overwrite tables that have the same name. Export the current database first as a backup.

  1. Create an empty database first if you do not have one. You can do this in MySQL Databases in cPanel.
    Screenshot: Create an empty database first if you do not have one. You can do this in MySQL Databases
  2. Open phpMyAdmin and click that database on the left.
  3. Click the Import tab.
  4. Click Choose File and pick your .sql file.
    Screenshot: Click Choose File and pick your .sql file.
  5. Leave the other settings as they are.
  6. Click Go at the bottom.

When it finishes, you will see a green message. Your tables now show on the left.

Common problems

  • File too large: phpMyAdmin has an upload limit. Compress the file with zip, or ask Hostvento support about raising the limit.
    Screenshot: File too large: phpMyAdmin has an upload limit. Compress the file with zip, or ask Hostven
  • Timeout: A big import can stop halfway. Split the file into smaller parts, or ask support to import it.
  • Error near some line: The file may be damaged or made for a different MySQL version. Export it again if you can.

Need help? Open a support ticket.

Quick recap

  • Export saves a database to a .sql file.
  • Import loads a file into a database.
    Screenshot: Import loads a file into a database.
    Screenshot: Import loads a file into a database.
  • Use the Export and Import tabs in phpMyAdmin.
  • Back up before you import over existing data.
    Screenshot: Back up before you import over existing data.
  • Large files may need compressing or help from support.