【xtrabackup故障】Failed to connect to MySQL to detect version

xtrabackup版本问题
本文记录了一次使用xtrabackup进行数据库备份时遇到的问题及解决过程。问题出现在备份与恢复过程中使用的xtrabackup版本不一致导致的数据校验错误。通过指定正确的MySQL版本参数成功解决了这一问题。

今天在做数据库备份数据遇到一个问题,主要原因是:备份和恢复的时候使用的xtrabackup的版本不一致

问题

使用xtrabackup校验数据的时候报错:

# innobackupex --apply-log /data/back/  
  
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy  
and Percona Ireland Ltd 2009-2012.  All Rights Reserved.  
  
This software is published under  
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.  
  
141125 09:43:44  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'backupuser'  (using password: YES).  
Failed to connect to MySQL server to detect version.  
You must set xtrabackup version to use with --ibbackup option.  
Possible values are xtrabackup_55 (for MySQL 5.5), xtrabackup_56 (for MySQL or Percona Server 5.6, or xtrabackup (for MySQL 5.1 with InnoDB plugin or Percona Server)  

根据报错提示,失败查明mysql的版本,需要指明--ibbackup选项,因为我的mysql是5.6版本的,所以我使用--ibbackup xtrabackup_56,
之前的备份还原是不需要添加该参数的,很奇怪,检查发现是备份的xtrbackup不是我经常使用的2.4,而是2.1.9,所以还原上面有些出入

解决:
# innobackupex --use-memory=1G --apply-log /data/back --ibbackup xtrabackup_56  

................................................... 
InnoDB: 5.6.17 started; log sequence number 3974285875212
[notice (again)]
  If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 365497561, file name mysql-bin.003475

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 3974285876610
171011 09:43:10  innobackupex: completed OK!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值