You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
云数据库 RDS
4.07GB
5.7
hins25487844_data_20240730052418_qp.xb
还原办法:
https://www.alibabacloud.com/help/zh/rds/apsaradb-rds-for-mysql/restore-the-data-of-an-apsaradb-rds-for-mysql-instance-from-a-physical-backup-file-to-a-self-managed-mysql-database
### 开始还原
cd /usr/local
因为备份文件太大, 无法使用rz -be,所以选择sftp上传 hins25487844_data_20240730052418_qp.xb
## 解包
mkdir /var/mysql_bkdata/ -p
cat hins25487844_data_20240730052418_qp.xb | xbstream -x -v -C /var/mysql_bkdata/
## 解压
innobackupex --decompress --remove-original /var/mysql_bkdata/
# 恢复前准备
innobackupex --defaults-file=/var/mysql_bkdata/backup-my.cnf --apply-log /var/mysql_bkdata/
# 编辑数据库配置文件
mkdir /var/mysql_newdata -p
vi /etc/my.cnf
# 修改
datadir = /var/mysql_newdata
############重要########################
# 参数innodb_undo_tablespaces的取值需要与/var/mysql_bkdata/backup-my.cnf中的取值相同, 您可以使用下面的命令来查询。
cat /var/mysql_bkdata/backup-my.cnf | grep innodb_undo_tablespaces
# 添加
# 这个值不是乱写的,是根据上面的查询命令获取到的
[mysqld]
innodb_undo_tablespaces=0
innodb_undo_directory= /var/mysql_newdata
# 恢复数据
innobackupex --defaults-file=/etc/my.cnf --copy-back /var/mysql_bkdata/
### 修改
vi /etc/my.cnf
# 增加
[mysqld]
lower_case_table_names=1
# 授权
chown -R mysql:mysql /var/mysql_newdata
# 启动
mysqld --defaults-file=/etc/my.cnf --user=mysql --datadir=/var/mysql_newdata &
------------------------------------------------------------------------------------------------------------