Skip to content

Instantly share code, notes, and snippets.

@felipelavinz
Created February 12, 2014 19:47
Show Gist options
  • Save felipelavinz/8963136 to your computer and use it in GitHub Desktop.
Save felipelavinz/8963136 to your computer and use it in GitHub Desktop.
dump each table from a database on a separate file
# from http://stackoverflow.com/a/9360947/1182872
for x in `mysql -u [username] -p[password] [db name] -e 'show tables'`; do mysqldump -u [username] -p[password] [db name] $x > "$x.sql"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment