MySQL SSH Export and Import Database in Shell Terminal

Posted: July 23, 2011 by Hacking & Relax in Mysql
Tags: , ,

In your favorite shell you can export a MySQL database and Import using the following.
on Ubuntu, my MySQL databases are located at
To Export a MySQL Database run:

mysqldump -v -u username -p database_name > dumpfile.sql

To Import a MySQL Database run:

mysql -v -u username -p database_name < dumpfile.sql


  1. Yane says:

    Thanks for this. It is very usefull for beginers!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s