phpMyAdmin — How to import a database or table

Overview

This article explains how to import the following:

  • A single table (that does not exist) into a database (that already exists in the panel)
  • All database content into an empty database (that already exists in the panel)

You must first create the database in your DreamHost panel before importing content.

It's not possible to create a database via SSH.

Importing a table

You can only import a table if it does not exist in the current database.

If the table does exist, an error is thrown and the import will not complete.

Importing a database

You can only import database content into a database that has already been created in the panel and is currently empty.

Locating your database credentials

View the following article for details on how to find your login credentials and log into phpMyAdmin:

This article assumes the database already exists in your DreamHost panel.

Import or restore a database or table

  1. Log into phpMyAdmin.
  2. Select the destination database on the left pane.
  3. Click on the Import tab in the top center pane.
  4. Under the File to import section, click Browse and locate the file with the .sql extension you wish to import.
  5. Check or uncheck the boxes for 'Partial import' and 'Other options'.
  6. From the Format dropdown menu, choose 'SQL'.
  7. Click the Go button at the bottom to import the database.

If you imported a database, all tables will show when selecting the database in the left panel of phpMyAdmin.

If you imported a table, the newly imported table will appear in the list of tables.

What if the file is too large to import via phpMyAdmin?

If the .sql file you're trying to import is larger than phpMyAdmin allows, the only other option is to import via SSH. View the following article for instructions:

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?