Last active
June 18, 2018 09:52
-
-
Save tony4d/5997845 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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