How to Import and Export a Database with phpMyAdmin Print

  • 0

phpMyAdmin lets you export a database to a .sql file and import one back in. Use it to take a quick copy before making changes, or to move a site's database to or from EDZNET.

Open phpMyAdmin

  1. Log in to cPanel and go to Databases › phpMyAdmin. It opens in a new tab.
  2. In the left-hand list, click the database you want to work with. Always select the database first, otherwise the import or export runs at the wrong level.

Export a database

  1. With the database selected, click the Export tab.
  2. Leave Export method as Quick and Format as SQL.
  3. Click Export (or Go). Your browser downloads the .sql file.

Choose Custom if you only want certain tables, or want the file compressed (gzip) to make it smaller.

Import a database

  1. Create an empty database and user first if you haven't already (see create a MySQL database and user).
  2. In phpMyAdmin, click the empty database in the left-hand list.
  3. Click the Import tab.
  4. Under File to import, click Choose File and select your .sql file (or a compressed .sql.gz or .zip).
  5. Leave the other options as they are and click Import (or Go). A green success message confirms it worked.

Troubleshooting

  • File too large: the Import page shows the maximum upload size. Compress the file as .sql.gz, which often shrinks it a lot. If it's still too big, open a support ticket and we'll advise on the best way to get it imported.
  • "No database selected": click the database in the left-hand list before opening the Import tab.
  • "Table already exists": you're importing into a database that already holds those tables. Import into an empty database, or export with the Add DROP TABLE option ticked (under Custom).
  • Site can't connect after the move: update the database name, user and password in your app's configuration. The host is localhost.

To download a whole database without phpMyAdmin, use Files › Backup instead (see partial backups).


Was this answer helpful?

« Back