How can I import a database using SSH?

Home » Knowledge Base » F.A.Q. » Database Management » How can I import a database using SSH?

You need to create an SSH account from your Control Panel > Hosting Tools > SSH Manager section.

Your database backup/dump can be imported using your configured SSH account by executing the following command through SSH:

mysql -h [DB HOSTNAME] -u [DB USERNAME] -p[DB PASSWORD] [DB NAME] < /home/www/database.sql

All the database settings – [DB HOST], [DB USER], [DB PASS], and [DB NAME] should be written exactly as they are displayed in your Hosting Control Panel > Database Manager section.

The dump file should be uploaded into your hosting account and the path /home/www/database.sql may vary depending on the place you uploaded the dump of your database. For example, if you have uploaded your MySQL dump file at /home/www/yourdomain.ext/backups/database.sql you should edit the command to look like this:

MySQL -h [DB HOSTNAME] -u [DB USERNAME] -p[DB PASSWORD] [DB NAME] < /home/www/yourdomain.ext/backups/database.sql

Note: You should make some slight modifications to your database.sql file prior to the import. You need to remove the CREATE DATABASE and USE commands at the first lines of your database.sql file. The lines in question are shown below:

−− CREATE DATABASE ‘username_db’ DEFAULT CHARACTER SET XXXX COLLATE XXXX;

−− USE username_db;

Was this post helpful?

i

Relevant tags:

Connect

Latest posts:

How to Install Themes in Zenphoto

Zenphoto allows you to customize the look of your online gallery by incorporating various themes. If you are interested in learning how to install themes in Zenphoto, then this article will guide you through the entire process - from browsing and downloading, through...

How to Add Tags in Zenphoto

Tags are a handy feature for organizing your Zenphoto images and albums. Tags not only help you and your visitors navigate more easily and quickly through your website, but also improve its discoverability in search engines, and can also help you generate more organic...

How to Upload Files in Zenphoto

Knowing how to upload files in Zenphoto is a fundamental skill. In this guide, we share how to go through the process and manage your project and media library quickly and easily.   Step 1: Log in to Zenphoto The first step in the process is to log in to...

How to Back Up your TYPO3 Project

In this article, we outline the step-by-step process for backing up your TYPO3 project, ensuring that all your data, settings, and other essential information are safely stored. Regardless of your level of expertise, this method is simple to follow and provides...

How to Install Themes in TYPO3

Learning how to install themes in TYPO3 is essential, as it enables you to personalize your website fully. Whether you are working on a personal blog or a complex business website, the process of installing a theme in TYPO3 is the same. In this article, we share how...



Create a website for free!


Free forever

Our Support Team is Here to Help

 

If you need any questions answered, don't hesitate and contact us. Click the button below and follow the instructions. You can expect an answer within an hour.

 

Contact AwardSpace

 

iNewest knowledge base articles

How to Install Themes in Zenphoto

Zenphoto allows you to customize the look of your online gallery by incorporating various themes. If you are interested in learning how to install themes in Zenphoto, then this article will guide you through the entire process - from browsing and downloading, through...

How to Add Tags in Zenphoto

Tags are a handy feature for organizing your Zenphoto images and albums. Tags not only help you and your visitors navigate more easily and quickly through your website, but also improve its discoverability in search engines, and can also help you generate more organic...

How to Upload Files in Zenphoto

Knowing how to upload files in Zenphoto is a fundamental skill. In this guide, we share how to go through the process and manage your project and media library quickly and easily.   Step 1: Log in to Zenphoto The first step in the process is to log in to...

How to Back Up your TYPO3 Project

In this article, we outline the step-by-step process for backing up your TYPO3 project, ensuring that all your data, settings, and other essential information are safely stored. Regardless of your level of expertise, this method is simple to follow and provides...

How to Install Themes in TYPO3

Learning how to install themes in TYPO3 is essential, as it enables you to personalize your website fully. Whether you are working on a personal blog or a complex business website, the process of installing a theme in TYPO3 is the same. In this article, we share how...

How to Add Extensions to TYPO3

TYPO3 is a versatile platform that allows you to customize it any way you wish. One of TYPO3's strengths is the so-called extensions that enable you to add any kind of functionality to your website. In this article, we share how to add extensions to TYPO3. What are...

Even more web tutorials

Check out our web hosting knowledge base and the WordPress tutorials to learn more, and be better prepared for your website creation and maintenance journey.