How do I import a database via SSH?

 

Important a database via SSH isn't complicated. However, it has to be done correctly; otherwise it can become complicated very quickly. Below is a brief outline of what should be done before you do the import:

Getting the database ready:

  1. Login to your cPanel hosting account.
  2. Create a database
  3. Create a username / password for your database
  4. Assign the username to your database (set all privileges)
  5. Your ready to start the import

Importing the database:

  1. Login to SSH (Secure Shell)
  2. You will need to use this line: mysql -u user -p dbname < {path}/backup.sql

    User = the username you created in step 3
    dbname = the database name you created in step 2
    backup.sql = this is the name of your .sql backup file

  3. Above you will need to update the line in step 2 and then paste the newly created line into the SSH window. It will ask you for a password which is the same password as you created in step 3.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to change a cPanel password through WHM?

  From time to time, account holders lose their passwords, and need to rest them. Using...

How to modify an account's disk quota in WHM?

  You can use Quota Modification directly from the WHM to affect on how much disk space...

Can I modify the suspended account page?

  Feel free to modify the suspended account page it to your liking. Follow these steps to...

How do I list the suspended accounts in WHM?

  If you want to list the suspended accounts, please do the following: Login to your WHM...

How to get info on bandwidth usage from WHM?

  This process is simple. Simply follow the below outlined instructions: Log to the WHM...

Powered by WHMCompleteSolution