Best command to backup MySQL database
mysqldump --hex-blob --extended-insert=false --complete-insert=true -uUSERNAME -pPASSWORD DATABASENAME > backup.sql
- --hex-blob
- Ensure that blob columns are exported correctly. MySQL will convert BLOB to hexadecimal.
- --extended-insert=false and --complete-insert=true
- Ensure that when backup.sql is imported back, it uses less memory. MySQL will generate a separate INSERT query for every record in every table instead of only generating one INSERT command per table.
If you think you have a better command, please comment.