How do I import a SQL “dump” file to MySQL?

If you have a backup (“dump”) file of a MySQL database (made either from our MySQL backup system or on another server), you can import that SQL dump file into our system.

If the file is smaller than 100 MB (uncompressed), the phpMyAdmin Web pages we provide can be used. If it’s larger, you’ll probably need to use the MySQL command line.

On this page:

Using phpMyAdmin

You’ll first need to create the new, empty database on our servers using the account control panel. After the new database has been created:

  1. Login to the new database using phpMyAdmin
  2. Click the database name on the left-hand side of the page
  3. Select the Import tab
  4. Click the Browse button under “File to import”, then select the database file from your computer
  5. Click Go to import the database

(If you see a “No database selected” error, it’s probably because you forgot to click the database name in step 2.)

Using the MySQL command line

To use the MySQL command line, you’d first upload the dump file to your Web site using an FTP program, etc.

Then you’d connect to the shell using telnet or SSH. When connected, type the following command, replacing “database_name” with the actual name of the MySQL database you want to use and “filename.dump” with the name of the file you uploaded:

mysql -u database_name -p database_name < filename.dump

You will be asked to enter a password. This is the password you chose when you created the MySQL database, not your master account password.

If you need assistance with this, please contact us and we’ll be glad to help.

What if I have a text file instead of a CSV file?

See our page explaining how you can import a CSV (comma separated values) text file into MySQL from Excel or a similar program.