innobackupex 恢复阿里云 RDS 备份数据

作者:Garany 发布于:2021-02-07 分类:破万卷书
1.安装qpress
wget "http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/183466/cn_zh/1608011575185/qpress-11-linux-x64.tar"
tar xvf qpress-11-linux-x64.tar 
cp qpress /usr/bin/

2.安装innobackupex
wget https://downloads.percona.com/downloads/Percona-XtraBackup-2.4/Percona-XtraBackup-2.4.21/binary/redhat/7/x86_64/percona-xtrabackup-24-2.4.21-1.el7.x86_64.rpm 
yum install libev perl-Digest-MD5 perl-DBD-MySQL -y
rpm -Uvh percona-xtrabackup-24-2.4.21-1.el7.x86_64.rpm 

3.解包
cat db_qp.xb |xbstream -x -v -C /root/mysqldata/

4.MySQL5.7解包
innobackupex --decompress --remove-original /root/mysqldata/

5.恢复解压好的备份文件
innobackupex --defaults-file=/root/mysqldata/backup-my.cnf --apply-log /root/mysqldata/

6.启动mysql
vim /root/mysqldata/backup-my.cnf
# This MySQL options file was generated by innobackupex.

# The MySQL server
[mysqld]
#innodb_checksum_algorithm=crc32
#innodb_log_checksum_algorithm=strict_crc32
innodb_data_file_path=ibdata1:200M:autoextend
innodb_log_files_in_group=2
innodb_log_file_size=1572864000
#innodb_fast_checksum=false
innodb_page_size=16384
#innodb_log_block_size=512
innodb_undo_directory=./
innodb_undo_tablespaces=0
server_id=2930129160
#redo_log_version=1
#server_uuid=a436465a-d56e-11ea-8133-7cd30ae46f58
#master_key_id=0
#innodb_encrypt_algorithm=AES_256_CBC

lower_case_table_names=1
skip-grant-tables 

chown -R mysql:mysql /root/mysqldata/

mysqld --defaults-file=/root/mysqldata/backup-my.cnf --user=root --datadir=/root/mysqldata/ &
mysql -h127.0.0.1 -uroot -p
mysql > show databases;

标签: mysql

我来说说