Skip to content

Instantly share code, notes, and snippets.

@royingantaginting
Last active March 19, 2023 16:49
Show Gist options
  • Save royingantaginting/a1c0558bbc5a04ff4e1e to your computer and use it in GitHub Desktop.
Save royingantaginting/a1c0558bbc5a04ff4e1e to your computer and use it in GitHub Desktop.
Safely dump database with mysqldump. Explanation for each options are the --hex-blob option to convert binary into hexadecimal, the --single-transaction option to lock database during the process, the --triggers option to dump triggers, the
mysqldump -u[user] -p --hex-blob --single-transaction --triggers --routines [database name] > [database-name]-`date +%y%m%d-%H%M%S`.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment