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
/var/lib/mysql/database_name
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

Source: http://stuffthatspins.com/2011/05/06/mysql-ssh-export-and-import-database-in-shell-terminal-dump/

Advertisements
Comments
  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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s