您的位置:首页 > 数据库 > MySQL

使用innobackupex备份mysql遇到的问题

2015-06-04 17:40 513 查看
环境说明:

操作系统: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

后来可以,说明是版本的问题。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: