How to Import MySQL Database using SSH?

Follow the below given steps to import MySQL database using SSH.
  • Login to cPanel and go to MySQL Database in DATABASES section.
  • Create a Database.
  • Add New User by specifying Username, Password and then click on Create User button.
  • Now, Add User to Database.
  • Manage All User Privileges and click over Make Changes.
  • Now, Login to Filezilla.
  • Drag and drop .sql file from local to remote (outside public_html).
  • Now go back to cPanel and locate the .sql file at the same path i.e outside public_html.
  • Login to SSH at user level and execute the command provided below to import MySQL database from an SQL file.
mysql -u USERNAME -p DB_NAME < import_file.sql
  • Enter the password and it will start importing data.
Thus, you have successfully imported MySQL database using SSH.
Check the video tutorial and blog to learn in detail procedure for the same.
  • How to Import MySQL Database using Command line, How to import database in MySQL via command line, How to Import MySQL Database using SSH Command line, Import MySQL database using Command line
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What are some Basic SSH commands?

List of some basic SSH commands are: ls – This command is used to list all files and...

How to connect to SSH?

Putty is an open-source SSH client used to connect to a remote server. This article describes how...

20 Basic Linux Commands and their Uses.

Following are the top 20 basic Linux Commands with Live Examples that would definitely help you...

How to Block/Unblock IPs from SSH?

You can easily block or unblock IPs  from SSH. #1. Block An IP Address from SSH First of all,...

How to install CpCleaner in cPanel through SSH?

CpCleaner is a cPanel plugin created to give cPanel users the option to clean junk files that...