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

Import and export a MySQL database with phpMyAdmin

This guide shows how to save a copy of a database to your computer and how to load one back in, using phpMyAdmin in DirectAdmin.

DirectAdmin2 min read16 steps6 screenshots

What are these words?

A database is an organised store of information. Many websites, such as WordPress sites, keep their posts and settings in one. MySQL is a popular kind of database. phpMyAdmin is a web tool that lets you look inside a MySQL database with clicks instead of code.

Exporting means saving the database as a file. Importing means loading a file into a database.

Open phpMyAdmin

  1. Log in to DirectAdmin.
  2. Click MySQL Management in the Extra Features or Account Manager section.
    phpmyadmin 1024x183
  3. Click the database name, or the link to phpMyAdmin.
  4. Log in with the database user name and password if asked.

Export a database

  1. In phpMyAdmin, click your database name on the left.
    Screenshot: In phpMyAdmin, click your database name on the left.
  2. Click the Export tab at the top.
  3. Choose Quick to export everything with default settings.
  4. Make sure the format is SQL.
  5. Click Export (or Go).
  6. Your browser downloads a file ending in .sql. Keep it safe.

Import a database

Warning: Importing can overwrite tables that already exist. Export a backup of the current database first.
  1. In phpMyAdmin, click the database you want to fill. It must exist already. Create it in MySQL Management if needed.
  2. Click the Import tab.
  3. Click Choose File and pick your .sql file. A .zip or .gz file also works.
  4. Leave the other settings as they are.
    Screenshot: Leave the other settings as they are.
  5. Click Import (or Go) at the bottom.
  6. Wait for the green success message.
    Screenshot: Wait for the green success message.

If the import fails

  • File too big: phpMyAdmin has an upload limit. Compress the file as .zip, or ask Hostvento support to import it.
  • Timeout: The task took too long. Split the file or ask support.
  • Errors about existing tables: Clear the old tables first, after taking a backup.

After importing a website database, check that your site's config file points to the right database name, user and password.

Quick recap

  • Open phpMyAdmin from MySQL Management in DirectAdmin.
    Screenshot: Open phpMyAdmin from MySQL Management in DirectAdmin.
  • Use Export to save a .sql file.
    Screenshot: Use Export to save a .sql file.
  • Use Import to load a file into a database.
  • Always back up before importing.