centos 6.5 阿里云RDS数据备份下载和恢复

下载解压缩软件:

# 下载解压脚本
wget http://oss.aliyuncs.com/aliyunecs/rds_backup_extract.sh
# 解压文件
./rds_backup_extract.sh -f hins382089_xtra_20160114033100.tar.gz  -C /home/database/mysql3306/data_new

下载备份恢复软件:

# 下载备份恢复软件
wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.2.13/binary/redhat/6/x86_64/percona-xtrabackup-22-2.2.13-1.el6.x86_64.rpm
      
# 其他版本下载地址:
    https://www.percona.com/downloads/XtraBackup/
      
# 安装以下依赖包:
    yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL
# 安装:
    rpm -ivh percona-xtrabackup-22-2.2.13-1.el6.x86_64.rpm

完全恢复数据:

/etc/init.d/mysql3306 stop  # 停止mysql数据库
      
mv /home/database/mysql3306/data /home/database/mysql3306/data_old # 备份旧文件
mv /home/database/mysql3306/data_new /home/database/mysql3306/data # 新数据转移至mysql数据文件夹
      
cd /home/database/mysql3306/data
innobackupex --defaults-file=./backup-my.cnf --apply-log ./ # 开始恢复

出现如下信息即完成:

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1729179606205
160115 17:18:36  innobackupex: completed OK!
chown -R mysql.mysql ./
/etc/init.d/mysql3306 start # 启动mysql数据库


参考网址:https://help.aliyun.com/knowledge_detail/5973700.html?spm=5176.2020520104.0.0.82NxXN

by 雪洁 2016-01-15 10:09:42 1743 views
我来说几句

相关文章