How to Import export MySQL database from command line
|
|
This tip would be useful for those who are either making backup of their remote mysql database or moving their web hosting to their provider.
Here’s how to export mysql DB to SQL file using command-line utility :
mysqldump –user=username –password=1234 –databases your_database –opt –quote-names –complete-insert > example.sql
Here’s how to import the SQL back into mysql database :
mysql –user=username –password=1234 –databases your_database –host=mysql_server host
Don’t forget to add your ip address to the list of allowable host on the remote MySQL server!
Tags: commandline, database, db, guides, linux, mysql, opensource, tips, unix, webhosting, webserverKeep updated with this website! : Subscribe to your email
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.


January 19th, 2009 at 1:41 pm
Nice one. Thanks.
//Jadu, unstableme.blogspot.com
January 28th, 2009 at 5:19 am
I use it nice article thank you
March 18th, 2009 at 11:05 pm
I’ve also used
mysql -u username -p databasename > backup.sql
May 8th, 2009 at 1:43 am
I need try this. This is interesting.
May 26th, 2009 at 11:55 pm
mysql -u username -p databasename > backup.sql
thanks
June 29th, 2009 at 2:01 pm
Thanks a useful document
Dedicated Colocation Voip Datacenter