Skip to content

Instantly share code, notes, and snippets.

@tymyshoe
Forked from maizhibin/mysqldump_all_databases
Last active August 29, 2015 14:18
Show Gist options
  • Save tymyshoe/937470a4de41200b7e2d to your computer and use it in GitHub Desktop.
Save tymyshoe/937470a4de41200b7e2d to your computer and use it in GitHub Desktop.
mysqldump -u tymyshoe -p password --host=hublogik.crmf51oxrvmc.us-east-1.rds.amazonaws.com hublogik_test --add-drop-table --single-transaction --complete-insert > database_dump.sql
--complete-insert
By default mysqldump includes INSERT statements built to *follow* create statements. So the assume all the columns match. If you break up your schema & data you could potentially have a mismatch. This option makes sure the INSERT statemens included in the dump specify column names. So if they don't match, you'll get a proper error message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment