Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using mysqldump for backups on a slave. Note the use of --master-data=2, this makes sure we get a global read lock and write out a comment in the sql file with the master log filename and current position. Now this backup is good for adding or bringing back a slave from scratch.
mysqldump -u [user] -p -xQce -R --master-data=2 --max-allowed-packet=1024M -B [db_name] | gzip > [db_name].sql.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.