When you are importing a database over 50MB, you will run into the limitation in your PhpMyAdmin that prevents you from importing a database over 50MB. On shared servers you can try installing your own PhpMyAdmin to import it or you will need to contact tech support to import it for you.

On VPS and Dedicated servers, you can install your own PhpMyAdmin or you can import the database using shell. This article will explain how to import a database through shell on a VPS or Dedicated server.

textImportant! You must first have a database created like the image to the right.

Steps to Import a database through shell

Note! This is for VPS and Dedicated servers only.

  1. Login to your server via SSH.
  2. Go to the directory your backup .sql file is located in. For example, if your database backup is named new_databse.sql in your cPanel home directory for userna5, you will change to that directory like the following command.
    cd /home/userna5
  3. Check the directory for your .sql file by typing ll. You should see an output similar to below:
    root@vps#### [/home/userna5]# ll
    total 328
    drwx--x--x 21 userna5 userna5   4096 Apr 30 15:40 ./
    drwx--x--x 17 root     root       4096 Dec  6 16:28 ../
    lrwxrwxrwx  1 userna5 userna5     34 Apr 14  2011 access-logs -> /usr/local/apache/domlogs/userna5/
    drwxr-xr-x  2 userna5 userna5   4096 Oct  9  2012 bin/
    -rw-r--r--  1 root     root     201467 Apr 30 15:40 new_databse.sql
    -rw-r--r--  1 userna5 userna5   4264 Apr 30 12:10 error_log
    drwxr-x---  3 userna5 mail       4096 Feb 22 09:02 etc/
    drwxr-x--x  9 userna5 userna5   4096 Feb 21 09:53 mail/
    drwxr-xr-x  3 userna5 userna5   4096 Mar 27 11:26 perl/
    lrwxrwxrwx  1 userna5 userna5     14 Mar 27 11:26 perl5 -> perl/usr/local/
    drwxr-xr-x  9 userna5 userna5   4096 Oct  9  2012 php/
    drwxr-xr-x  3 userna5 userna5   4096 Apr 14  2011 public_ftp/
    drwxr-x--- 47 userna5 userna5   4096 Apr 26 13:17 public_html/
    drwxr-xr-x 10 userna5 userna5   4096 Apr 23 11:30 tmp/
    lrwxrwxrwx  1 userna5 userna5     11 Apr 14  2011 www -> public_html/
  4. Next you can Import the database.

    user_name: This is your cPanel username or the database user you created and added to the database.
    data_base: This is the name of the database. In this example its userna5_tester.
    new_databse.sql: This is the name of the database you want to import into your empty database on your server.

    The general syntax for the command is as follows:

    mysql -p -u user_name data_base < new_databse.sql

    In this example we will use the cPanel Username. Hit Enter.

    mysql -p -u userna5 userna5_tester < new_databse.sql
  5. You will be asked to enter your password like the following. Enter the users password. (For the cPanel user you use the cPanel password. If you added a user to the database, you will use that users password.)
    root@vps#### [/home/userna5]# mysql -p -u userna5 userna5_tester < new_databse.sql
    Enter password:

    textWhen the database is finished you will get the prompt again. Check your database in your cPanel. You should see Megabytes taken in the size column like the image to the right.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!