How to Import MySQL Database using SSH Command line?

How to Import MySQL Database using SSH Command line? [STEP BY STEP]☑️

This documentation will help you learn How to import MySQL Database using Command line. Watch the video tutorial on how to import MySQL database using SSH Command line.

If you don’t want to watch the video tutorial, skip and proceed with the text version mentioned below.

Follow the steps described below to import a Database via command line:

Step::1 Login to cPanel and go to MySQL Database in DATABASES section

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

Step::2 Create a Database

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

Step::3 Add New User by specifying Username, Password and then click on Create User tab

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

Step::4 Next Add User to Database By specifying Username and associated Database, then click Add

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

Step::5 Manage All User Privileges and click on Make Changes tab

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

Step::6 Now Login to Filezilla using credentials

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

 

Step::7 Drag and drop .sql file from local to remote (outside public_html)

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

Step::8 Now go back to cPanel and locate the .sql file at the same path i.e outside public_html

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

Step::9 Next login to SSH at user level and execute the command provided below to import MySQL database from an SQL file.

mysql -uUSERNAME -p DB_NAME < import_file.sql

Step::10 It will ask you for the password. Enter the password and it will start importing data from the SQL file you have mentioned in the command.

How to Import MySQL Database using SSH Command line
How to Import MySQL Database using SSH Command line

So, this is how you can import databases in MySQL.

That’s all you are done!!!

We hope this video helped you learn How to Import MySQL Database using SSH Command line

For more information, kindly follow us on social media like Twitter and Facebook and for video tutorials, subscribe to our YouTube channelhttps://youtube.com/redserverhost.com

Facebook Page- https://facebook.com/redserverhost

Twitter Page- https://twitter.com/redserverhost.com

If you have any query, feel free to let us know via the comments section below.

Thanks for Reading!!!

Tags: cheap linux hostingbuy linux hostingcheap reseller hostingbuy reseller hostingbest reseller hostingcheap web hostingcheapest web hostingcheapest reseller hosting,  cheap reseller hostcheap linux hostcheapest linux hostingbest linux hostingbest web hosting

Scroll to Top