Skip to content

Instantly share code, notes, and snippets.

@zeloc
Created August 16, 2018 08:13
Show Gist options
  • Save zeloc/de7847e867ec839ef3fc56d1f598ad4e to your computer and use it in GitHub Desktop.
Save zeloc/de7847e867ec839ef3fc56d1f598ad4e to your computer and use it in GitHub Desktop.
mysqldump command with host and gz
# Taking a mysqldump with single transation:
# standard
mysqldump --single-transaction -u root -proot bettys_local > bak_060618.sql.gz
# with host
mysqldump --single-transaction -h 127.0.0.1 -u root -proot bettys_local > bak_060618_1.sql.gz
# with gz and host
mysqldump --single-transaction -h 127.0.0.1 -u root -proot bettys_local | gzip > bak_060618_11.sql.gz
# Note about host
# where a database is using a specific ip other then local ie and external one the you need to get
# the ip for the database from the etc/local.xml on the server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment