How to import/export database using MySql command line

To import database from dump file use:
mysql -u username -p password database_name < filename.sql

The easiest way to export is to use command prompt (cmd):
mysqldump -u USER -p PASSWORD DATABASE > filename.sql

One thought on “How to import/export database using MySql command line

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s