Wednesday, April 25, 2012

Script for fast Mysql Dump

This command will create a file named mysqldum.sql in the current dirrectory:


mysqldump DBNAME --add-drop-table -u USERNAME-p > mysqldump.sql

Remember when going to older versions of mysql to do a search and replace for "USING BTREE" as it is not supported in older mysql installs.

This file can then be imported via:

 mysql DBNAME -u USERNAME -p < mysqldump.sql 

This post is mostly for my own information, I keep forgetting the exact order of the arguments!

No comments:

Post a Comment