Skip to content

Instantly share code, notes, and snippets.

@TheRatG
Last active March 8, 2017 08:38
Show Gist options
  • Save TheRatG/5045e7616d1cfea18da94b6d7c2ce7e6 to your computer and use it in GitHub Desktop.
Save TheRatG/5045e7616d1cfea18da94b6d7c2ce7e6 to your computer and use it in GitHub Desktop.
mysqldump help
#!/usr/bin/env bash
USER=homestead
PASSWORD=secret
DATABASE=database
DB_FILE=/tmp/${DATABASE}.sql.gz
#dump specific table data
mysqldump --extended-insert --skip-lock-tables -u${USER} -p${PASSWORD} ${DATABASE} | gzip > ${DB_FILE}
#zcat ${DB_FILE} | mysql -u${USER} -p${PASSWORD} -D${DATABASE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment