使用innobackupex备份mysql遇到的问题

本文详细介绍使用Percona XtraBackup备份CentOS 5.4系统下MySQL 5.6.22数据库的过程。解决备份过程中遇到的问题,并分享了不同版本的XtraBackup对备份的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境说明:

操作系统:CentOS 5.4 (x64)

mysql版本:5.6.22 (源码包安装)(安装路径:/usr/local/mysql/)

xtrabackup版本: percona-xtrabackup-2.0.0.tar.gz 和 percona-xtrabackup-2.2.9-5067-Linux-x86_64.tar.gz


操作步骤:

1. 将percona-xtrabackup-2.0.0.tar.gz 解压后,将bin下的innobackupex拷贝到/usr/local/mysql/bin下

2. vim /root/.bash_profile

   export PATH=/usr/local/mysql/bin:$PATH

   source /root/.bash_profile

3. 开始备份

 

[root@langkeziju132 ~]# innobackupex  --user=root --password=123456  /data/backup/mysql


InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.


This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.


140628 23:29:54  innobackupex: Starting mysql with options:  --password=xxxxxxxx --user='root' --unbuffered --
140628 23:29:54  innobackupex: Connected to database with mysql child process (pid=5509)
140628 23:30:00  innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".


innobackupex: Using mysql  Ver 14.14 Distrib 5.6.22, for Linux (x86_64) using  EditLine wrapper
Warning: Using a password on the command line interface can be insecure.
innobackupex: Using mysql server version Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.


innobackupex: fatal error: no 'mysqld' group in MySQL options

innobackupex: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options


指定my.cnf

[root@langkeziju132 ~]# innobackupex --defaults-file=/usr/local/mysql/my.cnf --user=root --password='123456' /data/backup/mysql


InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.


This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.


140629 00:14:27  innobackupex: Starting mysql with options:  --defaults-file='/etc/my.cnf' --password=xxxxxxxx --user='root' --unbuffered --
140629 00:14:27  innobackupex: Connected to database with mysql child process (pid=5992)
140629 00:14:33  innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".


innobackupex: Using mysql  Ver 14.14 Distrib 5.6.22, for Linux (x86_64) using  EditLine wrapper
Warning: Using a password on the command line interface can be insecure.
innobackupex: Using mysql server version Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.


sh: --: invalid option
Usage:  sh [GNU long option] [option] ...
        sh [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --debugger
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --protected
        --rcfile
        --rpm-requires
        --restricted
        --verbose
        --version
        --wordexp
Shell options:
        -irsD or -c command or -O shopt_option          (invocation only)
        -abefhkmnptuvxBCHP or -o option
innobackupex: fatal error: no 'mysqld' group in MySQL options
innobackupex: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options


无果,换个版本试试:换percona-xtrabackup-2.2.9-5067-Linux-x86_64.tar.gz

后来可以,说明是版本的问题。


  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值