xtrabackup uses a default user even if different user is defined in users config file

Bug #1551706 reported by Hrvoje Matijakovic
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Status tracked in 2.4
2.3
Fix Released
High
Sergei Glushchenko
2.4
Fix Released
High
Sergei Glushchenko

Bug Description

Originally reported on the blogpost [1], xtrabackup uses a default user even if different user is defined in [client] section.

xtrabackup will use default user
when I have
[client]
user = xtrbackup
[mysqld]
user = mysql

innobackupex –defaults-file=/etc/my.cnf –slave-info –safe-slave-backup …

It use default user as mysql not xtrbackup.
It will use the last user in the config, not [client] section use.

[1] https://www.percona.com/blog/2016/02/23/33632/

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

xtrabackup will read both "mysqld" and "client" sections since it is single binary which needs to read both server and client settings... Ordering comes from core mysql code. Probably we can fix this issue completely only when all options will be read from server itself without even looking into "mysqld" section.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

workaround is to specify the user as cli argument

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

As follow-up, Xtrabackup should ignore user under [mysqld] because this user is not a MySQL server's user, it is a system user, which will own the MySQL process while starting, i.e MySQL server will start under that user.
http://dev.mysql.com/doc/refman/5.7/en/changing-mysql-user.html

In contrast the user under [client] is for client connection.

[client]
user = xtrbackup
[mysqld]
user = mysql

It is especially affected while doing some test in Jenkins. There will be no 'root' in jenkins, the default is 'jenkins' system user.

[client]
port=10000
socket=/tmp/mysql.sock
user=root
[mysqld]
basedir=/mnt/workspace/PTB-run-percona-server-5.6-pxb-2.3.5-2.4.4/Host/centos7-64/Percona-Server-5.6.33-rel79.0-Linux.x86_64.ssl101
datadir=/mnt/workspace/PTB-run-percona-server-5.6-pxb-2.3.5-2.4.4/Host/centos7-64/mnt/var/ps_5.6.33_sysbench/test-0/mysql.1/data
tmpdir=/mnt/workspace/PTB-run-percona-server-5.6-pxb-2.3.5-2.4.4/Host/centos7-64/mnt/var/ps_5.6.33_sysbench/test-0/mysql.1/tmp
port=10000
socket=/tmp/mysql.sock
pid-file=/mnt/workspace/PTB-run-percona-server-5.6-pxb-2.3.5-2.4.4/Host/centos7-64/mnt/var/ps_5.6.33_sysbench/test-0/mysql.1/mysql.pid
console
user=jenkins
server-id=1
general-log-file=/mnt/workspace/PTB-run-percona-server-5.6-pxb-2.3.5-2.4.4/Host/centos7-64/mnt/var/ps_5.6.33_sysbench/test-0/mysql.1/query.log

Temporary workaround was to create 'jenkins' user for MySQL.

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-463

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.