Skip to content

Instantly share code, notes, and snippets.

@timkinnane
Created June 21, 2013 01:09
Show Gist options
  • Save timkinnane/5828158 to your computer and use it in GitHub Desktop.
Save timkinnane/5828158 to your computer and use it in GitHub Desktop.
SSH, export and move MySQL database to remote host
mkdir -p db_export_tmp
mysqldump --add-drop-table -efK -u DB_USER -pPASS DB_NAME > tmp/DB_NAME.sql
mysql -h host -u DB_USER -pPASS DB_NAME < tmp/DB_NAME.sql
rm -rf db_export_tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment