Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Backup All MySQL Databases into Individual Gzipped Files in Current Directory
for db in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $db | gzip > "$db-$(date +%Y-%m-%d).sql.gz"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment