innobackupex don't take the default datadir

Bug #936934 reported by Martin Arrieta on 2012-02-20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to
Fix Released
Alexey Kopytov
Won't Fix
Fix Released
Alexey Kopytov

Bug Description

If you don't have any "datadir" option on you mysqld section of your my.cnf, the server start fine and use /var/lib/mysql as a default but innobackupex don't

[root@repmaster ~]# innobackupex backups/

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.

120220 09:58:49 innobackupex: Starting mysql with options: --unbuffered --
120220 09:58:49 innobackupex: Connected to database with mysql child process (pid=2448)
120220 09:58:55 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.5.20, for Linux (x86_64) using readline 5.1
innobackupex: Using mysql server version Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

xtrabackup: Error: Please set parameter 'datadir'
innobackupex: fatal error: no 'mysqld' group in MySQL options
innobackupex: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

[root@repmaster ~]# cat /etc/my.cnf | grep -v ^#

port = 3306
socket = /var/lib/mysql/mysql.sock

port = 3306
socket = /var/lib/mysql/mysql.sock
server-id = 1

max_allowed_packet = 16M


key_buffer_size = 8M
sort_buffer_size = 8M


[root@repmaster ~]# rpm -qa | grep xtra

[root@repmaster ~]# cat /etc/issue
CentOS release 6.2 (Final)

[root@repmaster ~]# rpm -qa | grep -i percona

Related branches

Changed in percona-xtrabackup:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Valentine Gostev (longbow)
Cormac (cormac-mcgaughey) wrote :

Can you try using:

 innobackupex --ibbackup=xtrabackup backups/

I've found this and it's not picking the binary up correctly on Centos 6

Testing using:
env PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS /usr/bin/innobackupex --defaults-file=/etc/my.cnf /backup

This happens (several hundred lines snipped):
2174: if ($option_defaults_file) {
2175: $options = $options . " --defaults-file=\"$option_defaults_file\" ";
2178: $options = $options . "--print-param";
2183: $cmdline = "$option_ibbackup_binary $options";
2184: @lines = `$cmdline`;

It ended up execing:

--defaults-file="/etc/mysql/bluebox.cnf" --print-param

and threw this error.

The problem can be found in sub read_config_file where it's not correctly picking up the binary properly.

Alexey Kopytov (akopytov) wrote :


The problem you are observing looks unrelated to the original bug report. Though it seems similar to

Can you please make sure you are not running XtraBackup and Percona Server versions affected by that bug, and create a new one, if the problem persists with newer versions?

Stewart Smith (stewart) on 2012-06-15
tags: added: innobackupex
Changed in percona-xtrabackup:
assignee: Valentine Gostev (longbow) → nobody
status: Confirmed → Triaged
Alexey Kopytov (akopytov) wrote :

I'm not sure there's a reliable way to fix this. The server does have a default datadir value (which is a compile-time option, and for RPM builds is /var/lib/mysql), but XtraBackup does not. Defaulting to a specific location looks unreliable to me. I think XtraBackup should be explicit in this regard and not make any assumptions.

Changed in percona-xtrabackup:
status: Triaged → Won't Fix
Alexey Kopytov (akopytov) wrote :

This can be fixed by querying the datadir server variable from innobackupex. IIRC there are some cases when the default value of datadir is not reported correctly by the server, but that may have been fixed, as I'm unable to reproduce it now.

tags: added: i42483
Alexey Kopytov (akopytov) wrote :

This will be covered by Keeping this bug as the BluePrint has wider in scope, and fixing this bug will be more like a side-effect.

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers