Last active
December 17, 2015 06:09
-
-
Save tdantas/5563212 to your computer and use it in GitHub Desktop.
mysql backup instructions debian squeeze
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
$ sudo innobackupex --user=USER --password=PASSWORD PATH_TO_BACKUP_DIR |
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
$sudo innobackupex --apply-log --use-memory=1GB PATH_TO_BACKUP_DIR |
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
$ sudo service mysql stop | |
$ sudo mv /var/lib/mysql /var/lib/mysql.old | |
$ sudo innobackupex --copy-back PATH_TO_BACKUP_DIR | |
$ sudo chown -R mysql:mysql /var/lib/mysql | |
$ sudo service mysql start | |
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
#!/usr/bin/env bash | |
DIR='xtrackbackup' | |
mkdir $DIR && cd $DIR | |
apt-get -y update | |
apt-get -y install libaio1 | |
wget http://www.percona.com/redir/downloads/XtraBackup/LATEST/deb/squeeze/x86_64/percona-xtrabackup_2.0.7-552.squeeze_amd64.deb | |
dpkg -i percona-xtrabackup_2.0.7-552.squeeze_amd64.deb | |
echo "COMPLETED" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment