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.
Was this answer helpful? 0 Users Found This Useful (0 Votes)