MySQL DBA - Tips and Techniques Magazine

14 Oct 2014

Take Static Backup of MYSQL Database

To take a static backup of a MYSQL database:

 

NOTE :

Backup example

 

mysqldump -uroot -pPASSWORD --single-transaction --all-databases | gzip) >

MYSQL-BACKUP-FILENAME.gz 2> MYSQL-BACKUP-ERROR.log

 

 

 

 

1) Stop Apache (Systems Team)

 

SYSTEMS WILL DO THIS

 

 

2) Stop slave on mk-lluprequal-2 (DBA)

 

Connect to mysql

mysql -uroot -p'XXXXXXX'

 

 

type in

 

mysql > show slave status \G

 

mysql > stop slave

 

mysql > show slave status \G

"Keep information safe somewhere"

 

 

3) Take Backup of MYSQL DB (DBA)

 

(check crontab for backup script location)

/home/backup/backup_dbs.sh

 

 

4) Take note of replication log information.

 

Connect to mysql

mysql -uroot -p'XXXXXXX'

 

 

type in

 

duplicate command from step 3

mysql > show slave status \G

 

"Keep information safe somewhere"

 

 

5) Restart slave on mk-lluprequal-2 (DBA)

 

 

mysql > start slave \G

 

 

6) Restart Apache (Systems Team)

 

SYSTEMS WILL DO THIS

No comments:

Post a Comment