Skip to content

Instantly share code, notes, and snippets.

@firstrow
Created March 31, 2014 06:58
Show Gist options
  • Save firstrow/9886757 to your computer and use it in GitHub Desktop.
Save firstrow/9886757 to your computer and use it in GitHub Desktop.
Dumps all databases to separate file
mysql -uroot -pmysqlpass -e 'show databases' | while read dbname; do mysqldump -uroot -pmysqlpass "$dbname" > "$dbname".sql; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment