1-888-524-7148

Menu

Knowledge Base - How to import and export a MySQL Database from the command line ?

How to import and export a MySQL Database from the command line ?

1. Export A MySQL Database

This example shows you how to export a database. It is a good idea to export your data often as a backup. Using SSH, execute the following command:

mysqldump -u username -p database_name > dbname.sql

You will be prompted for a password, type in the password for the username and press Enter. Replace username, password and database_name with your MySQL username, password and database name File dbname.sql now holds a backup of your database and is ready for download to your computer.

2. Import A MySQL Database

The file must be in .sql format. It can not be compressed in a .zip or .tar.gz file. Start by uploading the .sql file onto the server. If you haven't already done so, create the MySQL database via the cpanel. Using SSH, navigate to the directory where your .sql file is. Next run this command:

mysql -p -u username database_name < file.sql

Note: The -p will prompt for your account's password.
Note: username is the user with rights to the database. If you are unsure what the username is you can use the same username and password used to sign into SSH.
Note: Make sure your database name has your Hostmonster username prefix with the _ (underscore) after it and the database name.

Contact e-mails

Sales
Department

sales@giganetwebhosting.com

 

Support Department

support@giganetwebhosting.com

 

Billing Department

billing@giganetwebhosting.com

(For customers with live account only)

 

*Anytime money back.

anytime money back guarantee on all hosting plans. Nothing to worry about.We are in Web Hosting business since 1997 and we know your needs, we do our best for customer satisfaction. Giganetwebhosting.com offers a 'No Questions Asked' Anytime money back guarantee with all unlimited web hosting plans. If you decide to cancel your account at anytime Giganet web hosting will refund you for the remainder of your term, excluding domain registration fees, for which we incur a cost. It's like a warranty that never expires! Your satisfaction is our top priority, and we're confident that you'll be pleased with our services. Best web hosting risk free !

Server Security

Best server maintenance and security.Our servers have special security applications that ensure a secure and reliable hosting environment. Our 24/7 network monitoring ensures that, if an issue does arise, we address it immediately. We provide many additional services and modifications to the default Operating System and control panel installation which greatly enhances the security, reliability, and compatibility of our servers and softwareand offer best web hosting solutions available to our clients. Secure and safe unlimited web hosting, Vps hosting and dedicated servers hosting.

Low Price Lifetime Guarantee

Price guarantee for account life

We offer you a price guarantee for any future account renewals. We guarantee that your renewal price will be the same or less for all unlimited web hosting plans. Don't fall for the high discount bargains which are offered by most hosting providers. Read the fine print and note that the initial discounted price is usually 50-90% lower than the standard price at which you will be FORCED to renew! Cheap web hosting and best web hosting combined !
 The only place for affordable hosting with top hosting services.