Skip to content

Instantly share code, notes, and snippets.

@mipmip
Created February 16, 2012 12:12
Show Gist options
  • Save mipmip/1844414 to your computer and use it in GitHub Desktop.
Save mipmip/1844414 to your computer and use it in GitHub Desktop.
copy mysql database in bash
#!/bin/sh
export APASS=rootpassword
export DB=dbname
export DBDEST=newdbname
mysqldump -uroot $DB -p$APASS | mysql -uroot -p$APASS $DBDEST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment