Innobackupex does not work with .mylogin.cnf
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Fix Released
|
High
|
Sergei Glushchenko | |
| 2.1 |
Won't Fix
|
Undecided
|
Unassigned | |
| 2.2 |
Won't Fix
|
Undecided
|
Unassigned | |
| 2.3 |
Fix Released
|
High
|
Sergei Glushchenko |
Bug Description
I am creating hashed authentication file - .mylogin.cnf using
mysql_
After making it:
root@ubuntu-14:~# mysql_config_editor print --all
[client]
user = root
password = *****
host = localhost
The Innobackupex (from both Xtrabackup 2.2.5 and 2.1.9) works well on latest Ubuntu and Fedora, but does not work on Centos 6 and Debian 7.
Systems, where this works:
root@ubuntu-14:~# cat /etc/issue
Ubuntu 14.04.1 LTS \n \l
root@ubuntu-14:~# dpkg -l|grep -i mysql
ii libdbd-mysql-perl 4.025-1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient-dev 5.6.21-1ubuntu14.04 amd64 MySQL development headers
ri libmysqlclient1
ii mysql-apt-config 0.3.1-1ubuntu14.04 all Auto configuration for MySQL APT Repo.
ii mysql-common 5.6.21-1ubuntu14.04 amd64 MySQL Common
ii mysql-community
ii mysql-community
ii percona-
root@ubuntu-14:~# innobackupex back/
(...)
141031 14:48:47 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:
141031 14:48:47 innobackupex: Connected to MySQL server
141031 14:48:47 innobackupex: Executing a version check against the server...
141031 14:48:47 innobackupex: Done.
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".
innobackupex: Using mysql server version 5.6.21
innobackupex: Created backup directory /root/back/
141031 14:48:47 innobackupex: Starting ibbackup with command: xtrabackup_56 --defaults-
innobackupex: Waiting for ibbackup (pid=15135) to suspend
(...)
141031 14:48:51 innobackupex: completed OK!
on Fedora:
[root@pmlap ~]# cat /etc/issue
Fedora release 20 (Heisenbug)
[root@pmlap ~]# rpm -qa|grep -i mysql
mysql-community
mysql-connector
mysql-community
perl-DBD-
mysql-community
mysql-community
mysql-community
On Centos6:
[root@vagrant-
mysql-community
mysql-community
mysql-community
mysql-utilities
perl-DBD-
mysql-community
mysql-community
mysql-connector
[root@vagrant-
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.6.21-log MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show grants;
+------
| Grants for root@localhost |
+------
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*D6C8439DDDCD2
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION |
+------
2 rows in set (0.00 sec)
[root@vagrant-
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
Get the latest version of Percona XtraBackup, documentation, and help resources:
http://
141031 14:58:47 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:
innobackupex: Error: Failed to connect to MySQL server: DBI connect(
description: | updated |
Changed in percona-xtrabackup: | |
status: | New → Confirmed |
Changed in percona-xtrabackup: | |
assignee: | nobody → Sergei Glushchenko (sergei.glushchenko) |
importance: | Undecided → High |
summary: |
- Innobackupex does not work with .mylogin.cnf on some Linux versions + Innobackupex does not work with .mylogin.cnf |
Alexey Kopytov (akopytov) wrote : | #2 |
DBD::MySQL is linked against older libmysqlclient.16 (i.e. without .mylogin.cnf) support in every supported distribution, even the latest CentOS and Ubuntu releases. But yes, even if that wasn't the case, both libmysqlclient and DBD::MySQL need to be modified to support the --load-path option, which is not something we can control.
Which means the only option is to either 1) implement full support for .mylogin.cnf in innobackupex. Which is of course non-trivial. Percona Toolkit has a similar request, so you may want to check with Frank on this; or 2) implement https:/
Oracle's mysql-utilities use my_print_defaults to decrypt .mylogin.cnf and then just work with it's output. We can do the same for innobackupex.
Raghavendra D Prabhu (raghavendra-prabhu) wrote : Re: [Launchpad] [Bug 1388122] Re: Innobackupex does not work with .mylogin.cnf | #4 |
* On Wed, Dec 03, 2014 at 12:02:34PM -0000, Sergei Glushchenko <email address hidden> wrote:
>Oracle's mysql-utilities use my_print_defaults to decrypt .mylogin.cnf
>and then just work with it's output. We can do the same for
>innobackupex.
@Sergei
Note that this will make PXB dependant on mysql client packages again, something
that was removed earlier. This time it will be dependant on both client package
and perl-DBD-MySQL.
@Alexey
perl-DBD-MySQL in CentOS7 is built against libmysqlclient.
http://
libmysqlclient.
libmysqlclient.
Shahriyar Rzayev (rzayev-sehriyar) wrote : | #5 |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/
Here is how I see the issue
- innobackupex uses DBD::MySQL to talk to MySQL Server
- DBD::MySQL relies on libmysqlclient shipped with MySQL
- .mylogin.cnf support is built into libmysqlclient, this file is
always read
- in order to properly support .mylogin.cnf
- DBD::MySQL must be linked with correct version of libmysqlclient
- DBD::MySQL must provide an option to specify "--load-path"
- innobackupex must support "--load-path" option
- libmysqlclient must expose API to set "--load-path" value,
currently it only can be read from command line
I suggest first to check which version of libmysqlclient used by
DBD::MySQL on CentOS 6.