Skip to content

Instantly share code, notes, and snippets.

@jordantrizz
Created November 30, 2022 15:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordantrizz/79fd6c4de9bcb5fd35a3880418eb1199 to your computer and use it in GitHub Desktop.
Save jordantrizz/79fd6c4de9bcb5fd35a3880418eb1199 to your computer and use it in GitHub Desktop.
Backup all MySQL Databases on a Server
mysql -uroot -N -e 'show databases' | while read dbname; do mysqldump -uroot --complete-insert "$dbname" > "$dbname".sql; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment