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

percona-xtrabackup-2.1.3
mysql 5.1.28-rc
Red Hat Enterprise Linux AS release 4 (Nahant)

17:24:41 root@server1 [/usr/local/percona-xtrabackup-2.1.3/bin] # innobackupex /mysql_backup/mysql_backup

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.

130620 17:24:48 innobackupex: Starting mysql with options: --unbuffered –
130620 17:24:48 innobackupex: Connected to database with mysql child process (pid=411)
130620 17:24:54 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.1.28-rc, for redhat-linux-gnu (i686) using readline 5.1
innobackupex: Using mysql server version Copyright © 2000-2008 MySQL AB

innobackupex: fatal error: no ‘mysqld’ group in MySQL options
innobackupex: fatal error: OR no ‘datadir’ option in group ‘mysqld’ in MySQL options
17:24:54 root@server1 [/usr/local/percona-xtrabackup-2.1.3/bin] #

/etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data

Why? Please suggest

There shouldn’t be any problem. Can you please show me the output of

mysql> show variables like ‘datadir’;

Did you tried innobackupex with --defaults-file option ? e.g. --defaults-file=/etc/my.cnf

Hi,

12:18:19 root@server1 [~] # mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1660
Server version: 5.1.28-rc-log MySQL Community Server (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> show variables like ‘datadir’;
±--------------±-----------------------+
| Variable_name | Value |
±--------------±-----------------------+
| datadir | /usr/local/mysql/data/ |
±--------------±-----------------------+
1 row in set (0.00 sec)

mysql>

12:34:02 root@server1 [~] # innobackupex --defaults-file=/etc/my.cnf /mysql_backup/mysql_backup

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.

130621 12:34:18 innobackupex: Starting mysql with options: --defaults-file=’/etc/my.cnf’ --unbuffered –
130621 12:34:18 innobackupex: Connected to database with mysql child process (pid=5851)
130621 12:34:24 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.1.28-rc, for redhat-linux-gnu (i686) using readline 5.1
innobackupex: Using mysql server version Copyright © 2000-2008 MySQL AB

innobackupex: fatal error: no ‘mysqld’ group in MySQL options

mysql> show plugins;
±-----------±-------±---------------±--------±--------+
| Name | Status | Type | Library | License |
±-----------±-------±---------------±--------±--------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
±-----------±-------±---------------±--------±--------+
9 rows in set (0.01 sec)

I think i figured it out. From the Xtrabackup 2.1 documentation.
"Support for InnoDB 5.0 and InnoDB 5.1 builtin has been removed from Percona XtraBackup"

Can you try it with xtrabackup 2.0 or upgrade MySQL version ?

yes ,i try xtrabackup-2.0.7 ,The problem is still
i try Mysql 5.1.62 ,is OK.

@chanyipiaomiao,

Check that this error is valid “innobackupex: fatal error: no ‘mysqld’ group in MySQL options”, do you have a mysqld section on /etc/my.cnf?

Another reason innobackupex would fail with this error is that it cannot find the proper xtrabackup binary. What does which xtrabackup give you? What MySQL server are you running ? Try specifying the full path to the correct xtrabackup binary with the --ibbackup option to innobackupex.

Hello everyone,

Even i facing similar kind of problem

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.

130628 20:12:59 innobackupex-1.5.1: Starting mysql with options: --unbuffered –
130628 20:12:59 innobackupex-1.5.1: Connected to database with mysql child process (pid=1480)
130628 20:13:05 innobackupex-1.5.1: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex-1.5.1
prints “completed OK!”.

innobackupex-1.5.1: Using mysql Ver 14.14 Distrib 5.1.68, for unknown-linux-gnu (x86_64) using readline 5.1
innobackupex-1.5.1: Using mysql server version Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.

xtrabackup_51: ambiguous option ‘–log=/var/log/general_query.log’ (log-copy-interval, log-stream)
innobackupex-1.5.1: fatal error: no ‘mysqld’ group in MySQL options

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.

option_ibbackup_binary is autodetect, trying to connect to MySQL
Connected to MySQL with pid 1509
130628 20:13:06 innobackupex-1.5.1: Connection to database server closed
Connected successfully
130628 20:13:06 innobackupex-1.5.1: Starting mysql with options: --unbuffered –
130628 20:13:06 innobackupex-1.5.1: Connected to database with mysql child process (pid=1514)
130628 20:13:12 innobackupex-1.5.1: Connection to database server closed
IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex-1.5.1
prints “completed OK!”.

Could not open required defaults file: /home/mirror/mysql/backup-my.cnf
Fatal error in defaults handling. Program aborted

130628 20:13:12 innobackupex-1.5.1: Starting ibbackup with command: xtrabackup_51 --defaults-file="/home/mirror/mysql/backup-my.cnf" --defaults-group=“mysqld” --prepare --target-dir=/home/mirror/mysql --use-memory=2G --tmpdir=/tmp

Could not open required defaults file: /home/mirror/mysql/backup-my.cnf
Fatal error in defaults handling. Program aborted
xtrabackup_51 version 2.0.7 for MySQL server 5.1.59 unknown-linux-gnu (x86_64) (revision id: 552)
xtrabackup_51: Can’t change dir to ‘/home/mirror/mysql’ (Errcode: 2)
xtrabackup: cannot my_setwd /home/mirror/mysql
innobackupex-1.5.1: Error:
innobackupex-1.5.1: ibbackup failed at /usr/bin/innobackupex-1.5.1 line 386.

root@ecslave2 [~]# rpm -qa |grep percona
percona-xtrabackup-2.0.7-552.rhel6.x86_64
percona-release-0.0-1.x86_64
percona-toolkit-2.2.3-1.noarch
root@ecslave2 [~]

-Percona Xtrabackup latest version doesnt support hence installed older version.
-CentOS release 6.4 (Final)= 2.6.32-220.23.1.el6.x86_64
-Mysql 5.1.68

If any have solve or know the fix , please let us know.

-Kunal Modi

Hi,
Can you please paste my.cnf and detailed steps which you tried along with mysql version.

Hi,

After backup is completed, can you check where exactly it stored? As per your command line, it should be at /home/mirror/mysql but as per error log, innobackupex can’t able to find there.

[B]Could not open required defaults file: /home/mirror/mysql/backup-my.cnf[/B]
Fatal error in defaults handling. Program aborted
xtrabackup_51 version 2.0.7 for MySQL server 5.1.59 unknown-linux-gnu (x86_64) (revision id: 552)
[B]xtrabackup_51: Can't change dir to '/home/mirror/mysql' (Errcode: 2)[/B]
xtrabackup: cannot my_setwd /home/mirror/mysql
innobackupex-1.5.1: Error:
innobackupex-1.5.1: ibbackup failed at /usr/bin/innobackupex-1.5.1 line 386.

$ perror 2
OS error code 2: No such file or directory
$

Can you provide the command line for --apply-log, output of "ls -al /home/mirror/mysql " and confirm that backup is completed successfully?

Hi

Backup doesnt start and we get below error " innobackupex-1.5.1: fatal error: no ‘mysqld’ group in MySQL options "
Mysql,percona version is already mentioned in previous post.

===
root@ecslave2 [~]#
root@ecslave2 [~]# /usr/bin/innobackupex-1.5.1 --databases="<database_name>" /home/mirror/mysql --no-timestamp --defaults-file="/etc/my.cnf" --user=root --password=‘XX’ --socket=/var/lib/mysql/mysql.sock

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.

130702 18:47:47 innobackupex-1.5.1: Starting mysql with options: --defaults-file=’/etc/my.cnf’ --password=xxxxxxxx --user=‘root’ --socket=’/var/lib/mysql/mysql.sock’ --unbuffered –
130702 18:47:47 innobackupex-1.5.1: Connected to database with mysql child process (pid=6643)
130702 18:47:53 innobackupex-1.5.1: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex-1.5.1
prints “completed OK!”.

innobackupex-1.5.1: Using mysql Ver 14.14 Distrib 5.1.69, for unknown-linux-gnu (x86_64) using readline 5.1
innobackupex-1.5.1: Using mysql server version Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.

xtrabackup_51: ambiguous option ‘–log=/var/log/general_query.log’ (log-copy-interval, log-stream)
innobackupex-1.5.1: fatal error: no ‘mysqld’ group in MySQL options
root@ecslave2 [~]#
root@ecslave2 [~]#
root@ecslave2 [~]# ls -al /home/mirror/mysql
total 8
drwxr-xr-x 2 root root 4096 Jul 2 18:50 ./
drwxr-xr-x. 3 root root 4096 Jul 2 18:50 …/
root@ecslave2 [~]#

O/P of apply logs

===
root@ecslave2 [~]#
root@ecslave2 [~]# /usr/bin/innobackupex-1.5.1 --use-memory=2G --apply-log /home/mirror/mysql

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.

option_ibbackup_binary is autodetect, trying to connect to MySQL
Connected to MySQL with pid 7004
130702 18:52:26 innobackupex-1.5.1: Connection to database server closed
Connected successfully
130702 18:52:26 innobackupex-1.5.1: Starting mysql with options: --unbuffered –
130702 18:52:26 innobackupex-1.5.1: Connected to database with mysql child process (pid=7008)
130702 18:52:32 innobackupex-1.5.1: Connection to database server closed
IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex-1.5.1
prints “completed OK!”.

Could not open required defaults file: /home/mirror/mysql/backup-my.cnf
Fatal error in defaults handling. Program aborted

130702 18:52:32 innobackupex-1.5.1: Starting ibbackup with command: xtrabackup_51 --defaults-file="/home/mirror/mysql/backup-my.cnf" --defaults-group=“mysqld” --prepare --target-dir=/home/mirror/mysql --use-memory=2G --tmpdir=/tmp

Could not open required defaults file: /home/mirror/mysql/backup-my.cnf
Fatal error in defaults handling. Program aborted
xtrabackup_51 version 2.0.7 for MySQL server 5.1.59 unknown-linux-gnu (x86_64) (revision id: 552)
xtrabackup: cd to /home/mirror/mysql
xtrabackup: Error: cannot open ./xtrabackup_checkpoints
xtrabackup: error: xtrabackup_read_metadata()
xtrabackup: This target seems not to have correct metadata…
130702 18:52:32 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: Warning: cannot open ./xtrabackup_logfile. will try to find.
130702 18:52:32 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: Fatal error: cannot find ./xtrabackup_logfile.
xtrabackup: Error: xtrabackup_init_temp_log() failed.
innobackupex-1.5.1: Error:
innobackupex-1.5.1: ibbackup failed at /usr/bin/innobackupex-1.5.1 line 386.
root@ecslave2 [~]#

Please let me know if you wanted any other information.

-Regards
Kunal

Hi,

Looks like root cause of this error is, “xtrabackup_51: ambiguous option ‘–log=/var/log/general_query.log’ (log-copy-interval, log-stream)” . Deprecate log option is specified in my.cnf which is confusing xtrabackup. Can you replace “log” with “general-log” in my.cnf and try?

Btw: when backup is not completed successfully, there is no use to prepare it by --apply-log.

Regards,
Nil

Hi,

I need to create the incremental backups and restore them back. this is what I did

  1. Successfully Created incremental backups with innobackupex --folder names- BASEDIR, INCRDIR1, INCRDIR2, INCRDIR3

  2. Now I want to restore … I believe the following steps are right
    step1: innobackupex --apply-log --redo-only BASEDIR
    step2: innobackupex --apply-log --redo-only BASEDIR --incremental-dir=INCRDIR1
    step3: innobackupex --apply-log --redo-only BASEDIR --incremental-dir=INCRDIR2

and so on

Issue:
But when I run the first step I get the following error

Cound not open required default files /root/Downloads//backup-my.cnf
fatal error in defaults handling. program aborted

below is the stack trace:
got fatal error with the following stack trace @/usr/bin/innobackupipex line 4545…

We have given all the permission for the folder and etc

could some one help me pls

Hi,

I need to create the incremental backups and restore them back. this is what I did

  1. Successfully Created incremental backups with innobackupex --folder names- BASEDIR, INCRDIR1, INCRDIR2, INCRDIR3

  2. Now I want to restore … I believe the following steps are right
    step1: innobackupex --apply-log --redo-only BASEDIR
    step2: innobackupex --apply-log --redo-only BASEDIR --incremental-dir=INCRDIR1
    step3: innobackupex --apply-log --redo-only BASEDIR --incremental-dir=INCRDIR2

and so on

Issue:
But when I run the first step I get the following error

Cound not open required default files /root/Downloads//backup-my.cnf
fatal error in defaults handling. program aborted

below is the stack trace:
got fatal error with the following stack trace @/usr/bin/innobackupipex line 4545…

We have given all the permission for the folder and etc

could some one help me pls

Hi,

I need to create the incremental backups and restore them back. this is what I did

  1. Successfully Created incremental backups with innobackupex --folder names- BASEDIR, INCRDIR1, INCRDIR2, INCRDIR3

  2. Now I want to restore … I believe the following steps are right
    step1: innobackupex --apply-log --redo-only BASEDIR
    step2: innobackupex --apply-log --redo-only BASEDIR --incremental-dir=INCRDIR1
    step3: innobackupex --apply-log --redo-only BASEDIR --incremental-dir=INCRDIR2

and so on

Issue:
But when I run the first step I get the following error

Cound not open required default files /root/Downloads//backup-my.cnf
fatal error in defaults handling. program aborted

below is the stack trace:
got fatal error with the following stack trace /usr/bin/innobackupipex line 4545…

We have given all the permission for the folder and etc

could some one help me pls