Skip to content

Instantly share code, notes, and snippets.

@oleksii-zavrazhnyi
Created September 28, 2017 00:59
Show Gist options
  • Select an option

  • Save oleksii-zavrazhnyi/f152f97de5f8e0962b187d718016bfd4 to your computer and use it in GitHub Desktop.

Select an option

Save oleksii-zavrazhnyi/f152f97de5f8e0962b187d718016bfd4 to your computer and use it in GitHub Desktop.
Dump all MySQL databases in separate files
export PASSWORD=""
mysql -uroot -p$PASSWORD -e 'show databases' | while read dbname; do mysqldump -uroot -p$PASSWORD --complete-insert --some-other-options "$dbname" > "$dbname".sql; done
@oleksii-zavrazhnyi
Copy link
Copy Markdown
Author

Put your mysql password in first line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment