How do I import a .sql file via the command-line?

On the off chance that you've set up SSH access for a bundle, at that point you can run the following order line guidelines to import a MySQL database:

mysql - h hostname - u username - p username < databasefile.sql

The above order connects with your database with the - h (hostname) - u (username) - p (database name for this situation) at that point the unfastened document < databasefile.sql

You will at that point be provoked to enter a Password for the database. Input the Password and press enter.


Compressed files

In the event that the database record is zipped, at that point you should unzip it first. You can utilize one of the Following directions:

 

For a .compress document you can utilize the unzip command:

1. unzip databasefile.sql.zip
2. mysql - h hostname - u username - p username < databasefile.sql


For a .gz document you can utilize the gunzip command:
1. gunzip databasefile.sql.gz
2. mysql - h hostname - u username - p username < databasefile.sql

There is a guide about how to connect with your bundle through SSH here.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I create a MySQL database in Hamro.Cloud?

You can create MySQL databases in seconds specifically from your Hamro.Cloud control board....

How do I check MySQL Database sizes across packages in Hamro.Cloud?

Hamro.Cloud gives a simple method to view all MySQL database sizes over all packages in your...

How do I download or backup my MySQL Database?

There are different ways to send out your MySQL databases for safe keeping or transfer. The...

What is MS-SQL?

Microsoft SQL Server is a relational database management system (RDMS) developed by Microsoft. As...

How do I add Office 365 DNS records?

If you need email to course by means of Office 365 rather than Hamro.Cloud's Hamro.CloudMail...