RDS for MySQL 备份文件恢复到自建数据库遇到启动问题

RDS for MySQL 备份文件恢复到自建数据库

参见如下:

https://help.aliyun.com/knowledge_detail/41817.html


恢复启动时遇到如下错误:

 mysqld_safe --defaults-file=/home/mysqlbakup/backup-my.cnf --user=mysql --datadir=/home/mysqlbakup/ 

2016-10-28T01:17:58.928126Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.14) starting as process 2961 ...
2016-10-28T01:17:58.934128Z 0 [Note] InnoDB: PUNCH HOLE support not available
2016-10-28T01:17:58.934152Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-28T01:17:58.934155Z 0 [Note] InnoDB: Uses event mutexes
2016-10-28T01:17:58.934158Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2016-10-28T01:17:58.934190Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-10-28T01:17:58.934193Z 0 [Note] InnoDB: Using Linux native AIO
2016-10-28T01:17:58.934342Z 0 [Note] InnoDB: Number of pools: 1
2016-10-28T01:17:58.934412Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-10-28T01:17:58.936476Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-10-28T01:17:58.946301Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-10-28T01:17:58.949380Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-10-28T01:17:58.982063Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-28T01:17:59.000041Z 0 [ERROR] InnoDB: Log block 5160141 at lsn 2641991680 has valid header, but checksum field contains 1791751127, should be 1555321045
2016-10-28T01:17:59.000064Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 2641991739 and the end 2641991680.
2016-10-28T01:17:59.000072Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2016-10-28T01:17:59.603002Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-10-28T01:17:59.603060Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-10-28T01:17:59.603076Z 0 [ERROR] Failed to initialize plugins.
2016-10-28T01:17:59.603092Z 0 [ERROR] Aborting

删除/home/mysqlbakup/ 目录下的ib_logfile0和ib_logfile1重新启动就可以了


  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,关于MySQL数据库备份文件的下载,可以使用Python的boto3库来实现从RDS上下载备份文件。 首先,需要安装boto3库,可以使用pip安装: ``` pip install boto3 ``` 然后,需要在AWS控制台上创建一个IAM用户,并生成该用户的Access Key和Secret Access Key,并将该用户加入RDS的访问策略组中。 接着,可以使用以下Python代码来下载MySQL备份文件: ``` python import boto3 # 配置AWS访问密钥 aws_access_key_id = 'your_access_key_id' aws_secret_access_key = 'your_secret_access_key' # 创建rds client对象 client = boto3.client('rds', aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, region_name='your_rds_region') # 获取最近的mysql备份文件 response = client.describe_db_log_files( DBInstanceIdentifier='your_db_instance_id', FilenameContains='mysql', FileLastWritten=0 ) # 下载mysql备份文件 if len(response['DescribeDBLogFiles']) > 0: file = response['DescribeDBLogFiles'][0] filename = file['LogFileName'] download_response = client.download_db_log_file_portion( DBInstanceIdentifier='your_db_instance_id', LogFileName=filename ) with open('mysql_backup.sql', 'wb') as f: f.write(download_response['LogFileData']) ``` 需要将上面代码中的 `your_access_key_id`,`your_secret_access_key`,`your_rds_region`,`your_db_instance_id` 替换成自己的AWS访问密钥、RDS所在区域和实例ID。 这样,就可以通过Python从RDS上下载MySQL备份文件了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值