Today is mainly about restoring all.
1, installation percona-xtrabackup error handlingReference:http://blog.csdn.net/evils798/article/details/51433073 https:// My.oschina.net/u/1433006/blog/528262[[email protected] ~]# wget ftp://rpmfind.net/linux/dag/redhat/el6 /en/x86_64/dag/rpms/libev-4.15-1.el6.rf.x86_64.rpm [[email protected] ~]# wget http:// Mirror.centos.org/centos/6/os/x86_64/packages/numactl-2.0.9-2.el6.x86_64.rpm[[email protected] ~]# wget https://www.percona.com/downloads/XtraBackup/XtraBackup-2.1.5/RPM/rhel6/x86_64/ Percona-xtrabackup-2.1.5-680.rhel6.x86_64.rpm[[email protected] ~]# RPM-IVH libev-4.15-1.el6.rf.x86_64.rpm [[email protected] ~]# rpm-ivh numactl-2.0.9-2.el6.x86_64.rpmpreparing ... ########################################### [100%] 1:numactl ########################################### [100%][[email protected] ~] # RPM-IVH percona-xtrabackup-24-2.4.1-1.el6.x86_64.rpmwarning:percona-xtrabackup-24-2.4.1-1.el6.x86_64.rpm:header V4 DSA/SHA1 Signature, key ID Cd2efd2a:nokeypreparing #################################### ####### [100%] 1:percona-xtrabackup-24 ########################################### [100%] Note: percona-xtrabackup-24 version MySQL5.7 or above percona-xtrabackup-2.1.5 suitable for MySQL5.6
2, actual combat drills192.168.1.242 on-line main library backup data, copy to test environment 192.168.3.86 use a, copy all the data to 3,86b, 3.86 installation MySQL5.6.15, and normal start C, Install Backup tool percona-xtrabackup-2.1.5 version d, delete all databases, import data, restart the database
3. Error handlingMySQL appears error:page 1 log sequence number resolved: http://www.chengyongxu.com/blog/mysql%E5%87%BA%E7%8E% b0error-page-1-log-sequence-number%e8%a7%a3%e5%86%b3/Follow the instructions in my.cnf [mysqld] to add [mysqld] innodb_force_recovery = 6 (set below 6, or there will be a problem) normal startup, but is read-only mode, can only be queried. Can start normally, view log [[[email protected] ~]# tail-f/var/log/mysqld.log (need to get from disk when there is no data in cache) 2017-07-19 11:13:33 10824 [ERROR] Innodb:failed to find tablespace for table ' PMS '. Accountkpisheet "' in the cache. Attempting to load the tablespace with space ID 10.2017-07-19 11:13:48 10824 [ERROR] innodb:failed to find tablespace for Table ' PMS '. Adjustwishproductsschedule "' in the cache. Attempting to load the tablespace with space ID 16.2017-07-19 11:13:50 10824 [ERROR] innodb:failed to find tablespace for Table ' PMS '. Aliexpressaccount "' in the cache. Attempting to load the tablespace with space ID 3451350.2017-07-19 11:13:50 10824 [ERROR] innodb:failed to find Tablespac E for table ' PMS '. Tr_aliaccount_alicategory "' in the cache. Attempting to load the tablespace with space ID 389786.2017-07-19 11:13:51 10824 [ERROR] innodb:failed to find tablespace For table ' PMS '. Aliexpresscategory "' in the cache. Attempting to load the tablespace with space ID 617645.
4. Restore Steps[Email protected]_87 home]# innobackupex-user=root-password= '! QAZxsw2 '--apply-log/home/2017-08-06/2017-08-06_03-33-34/[[email protected]_87 home]# rm-fr/home/mysql/*[[email protected]_87 home]# Innobackupex--copy-back/home/2017-08-06/2017-08-06_03-33-34/[[email protected]_87 home]# chown -R mysql.mysql/home/mysql/[[email protected]_87 home]# kill-9 32217 31619[[email protected]_87 home]# ps aux |grep mysql /root 2586 0.0 0.0 103264 916 pts/0 S+ 15:10 0:00 grep mysql/[[email protected]_87 home]# /etc/init.d/mysqld restartERROR! MySQL server PID file could not being found! Starting MySQL ..... ..... SUCCESS
5. Set Permissions[[Email protected]_87 home]# mysql-uroot-p ' 123456 ' mysql> grant select,insert,update,delete on * * to ' root ' @ ' 192.168 .%.% ' identified by '! QAZXSW2 "; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Query OK, 0 rows Affected (0.00 sec) Client Connection test: [[email protected] classes]# mysql-h192.168.3.87-uroot-p ' 123456 ' Welcome to The MySQL Monitor. Commands End With; or \g.server version:5.6.15-log Source distributionmysql> show databases;
MySQL Backup Restore tool percona-xtrabackup