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 Access the AwardSpace Terms of Services

When you sign up for any of the AwardSpace hosting services, it is always a good idea to read our Terms of Service carefully. At AwardSpace, we want each user to know and understand their rights, responsibilities, and the scope of our services. Our Terms of Service...

How to Add Dynamic Fields in Vtiger

Vtiger is a versatile CMS that you can use for free with all AwardSpace hosting plans. The CMS offers numerous options to manage your online business, workflows, and team roles. Among other useful tweaks, Vtiger also provides you with dynamic fields and layouts that...

How to Add Tags in Vtiger

Tags in Vtiger grant you the possibility to quickly and efficiently organize and retrieve records. Tags work like labels, allowing you to distribute leads, contacts, opportunities, tickets, and other entries into different categories based on a set of criteria. What...

How to Set Up User Roles in Vtiger

User roles in Vtiger are an important feature that enables you to control access and determine how your team members interact with the system. By tweaking user roles, you can set up permissions, control access levels, and make sure that sensitive business information...

How to Install Extensions on Vtiger

Vtiger is a versatile open-source platform that helps you with managing your business processes - streamline customer relationships, manage sales, manage your team, and more. One of the platform's great features is the ability to add new functionalities by installing...



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 Access the AwardSpace Terms of Services

When you sign up for any of the AwardSpace hosting services, it is always a good idea to read our Terms of Service carefully. At AwardSpace, we want each user to know and understand their rights, responsibilities, and the scope of our services. Our Terms of Service...

How to Add Dynamic Fields in Vtiger

Vtiger is a versatile CMS that you can use for free with all AwardSpace hosting plans. The CMS offers numerous options to manage your online business, workflows, and team roles. Among other useful tweaks, Vtiger also provides you with dynamic fields and layouts that...

How to Add Tags in Vtiger

Tags in Vtiger grant you the possibility to quickly and efficiently organize and retrieve records. Tags work like labels, allowing you to distribute leads, contacts, opportunities, tickets, and other entries into different categories based on a set of criteria. What...

How to Set Up User Roles in Vtiger

User roles in Vtiger are an important feature that enables you to control access and determine how your team members interact with the system. By tweaking user roles, you can set up permissions, control access levels, and make sure that sensitive business information...

How to Install Extensions on Vtiger

Vtiger is a versatile open-source platform that helps you with managing your business processes - streamline customer relationships, manage sales, manage your team, and more. One of the platform's great features is the ability to add new functionalities by installing...

How to Log in to Vtiger

Vtiger is a versatile platform that allows you to manage your business processes from a single place. It helps you organize customer data, optimize workflows, and improve team collaboration from a handy dashboard that is instantly available once you install the...

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.