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

Import a MySQL Database in cPanel

This guide shows how to put a saved database file into a new MySQL database on your hosting account.

Databases2 min read12 steps3 screenshots

What does import mean?

A database is where your website keeps its data. An export is a copy of a database saved as a file, usually ending in .sql. Import means loading that file into a database. You do this when you move a site from another host or restore a backup.

Importing has three parts. First make an empty database. Then make a user. Last, load the file.

Step 1: Create the database

  1. Log in to cPanel.
  2. Open MySQL Databases.
  3. Under Create New Database, type a name and click Create Database.

Step 2: Create a user

  1. On the same page, go to MySQL Users.
  2. Type a user name and a strong password. Click Create User.
  3. Under Add User To Database, pick the user and the database. Click Add.
  4. Tick ALL PRIVILEGES and click Make Changes.

cPanel adds your account name before the names. Write down the full names and the password. Your website's settings will need them.

Step 3: Import the file

  1. Go back to the cPanel home page and open phpMyAdmin.
    database1
  2. Click your new database on the left.
  3. Click the Import tab.
    database2
  4. Click Choose File and select your .sql file. A zipped or gzipped file also works.
  5. Leave the defaults. Click Go.

A green message means it worked. Your tables show on the left.

Warning: If you import into a database that already has data, tables with the same name may be overwritten. Export a backup first.

database3

Step 4: Connect your website

Edit your site's settings file so it uses the new database name, user and password. For WordPress, this is wp-config.php.

Problems

  • File too big: compress it into a zip file. Or ask Hostvento support to raise the limit or import it.
  • Timeout: split the file into parts.
  • Error in the file: check it was made by MySQL, with a name that ends in .sql.

Need help? Open a support ticket.

Tip: Keep the original file until you have checked the site works.

Quick recap

  • Create a database and a user, then link them.
  • Import the .sql file in phpMyAdmin with the Import tab.
  • Update your site's settings with the new names.
  • Back up before importing into a database with data.