Case Description:
6 Yue 25 when making blind period data, the date 101 in trademarknew in 48 replicate tables to 50 in trademarknew library, misuse copied to the trademark library, resulting in trademark covered table in the library.
Recovery ideas:
To ensure the 50 non-stop, you must heat recovery. Today is Monday, Sunday's full backup can be transferred to the 52 on the machine ( 5.7 ), in 52 use the xtrabackup recover data tool. After recovery, the 48 tables using mysqldump back up, and then to the backup transmission 50 , the heat recovery operation performed.
The recovery process:
- First backup transmission to 52 on
Scp -r /backup/2018-06-24/ 172.16.1.52:/backup
- The original data file deletion
Rm -rf /var/lib/mysql/*
- Close the database
Service mysqld stop
- The backup file recovery (14.20 resumed )
Innobackup --apply-log /backup/2018-06-24
Innobackup --copy-back /backup/2018-06-24
- After the recovery is complete open the database ( 16 points recovery is complete)
Service mysqld start
- The 45 tables are modified using mysqldump back out
mysqldump -uroot -p trademark tm_goods_trans1 > /backup/1.sql
Error, because more gtid-mode parameters
do it again
mysqldump --set-gtid-purged=off -uroot -pswtm_8%-sIN trademark tm_goods_trans1 > /backup/1.sql
Error, execute the following statement
mysql_upgrade -u root -pswtm_8%-sIN --force
All states appear as tables ok
Restart the database
Backup again
mysqldump --set-gtid-purged=off -uroot -pswtm_8%-sIN trademark tm_goods_trans1 > /backup/1.sql
success!
- The backup transmission to 50 on
scp -r /backup/1.sql 172.16.1.50:/backup/
- 50 database is now emptied related tables, then execute source operation to restore the database
Mysql> source /backup/1.sql;