How to export and import a mysql database using Command Prompt?

Export SQL database

First login to your control panel and find the Terminal icon or login to your account via SSH this way:

ssh zen4.coolice.host

Note: nameserver could be with different name depending on what plan you have with CooliceHost.com

Then use this command to export your database:

mysqldump -u your_user -p your_database > wanted_name.sql

You will then be prompted for the database password - Enter password:
This exports the database to the path you are currently in, while executing this command. Mainly in home/


Import SQL database

Again login to your control panel and find the Terminal icon or login to your account via SSH this way:

ssh zen4.coolice.host

Then use this command to import your database:

mysql -uyour_user -p your_newdatabase < your_database.sql

You will then be prompted for the database password - Enter password:
-u and your_user are sticked together in -uyour_user

You need to have your database in the root directory after login. You can upload it via control panel or FTP client.


Was this article helpful?

mood_bad Dislike 0
mood Like 8
visibility Views: 2146