mysqldump doesn't pick up /etc/mysql/my.cnf

Bug #342578 reported by Thomas
4
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: mysql-client-5.0

Ubuntu 8.04.1
mysql-client-5.0.51a-3ubuntu5.1

/usr/bin/mysqldump doesn't read /etc/mysql/my.cnf - it tries to read /etc/my.cnf and $HOMEDIR/.my.cnf, but thats it. An upstream, i.e. debian fellow told me that the debian package does work as it should. I've helped myself out with a symlink from /etc/my.cnf, but this should be fixed.

Yes, I know mysql-5.1 will also look for /etc/mysql/my.cnf (http://dev.mysql.com/doc/refman/5.1/en/option-files.html), but again, this is still 5.0.

Revision history for this message
Mathias Gug (mathiaz) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Testing mysqldump on hardy shows that /etc/mysql/my.cnf is opened and read:

mathiaz@t-mysql-h:~$ strace mysqldump 2>&1 | grep 'my.cnf'
stat("/etc/mysql/my.cnf", {st_mode=S_IFREG|0644, st_size=3926, ...}) = 0
open("/etc/mysql/my.cnf", O_RDONLY) = 3
stat("/home/mathiaz/.my.cnf", 0x7fff0d7f0fc0) = -1 ENOENT (No such file or directory)
stat("/usr/etc/my.cnf", 0x7fff0d7f0fc0) = -1 ENOENT (No such file or directory)

Setting options under mysqldump section in /etc/mysql/my.cnf is also working correctly.

Could you outline what doesn't work for you?

Changed in mysql-dfsg-5.0:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Thomas (me-thomaskeller) wrote :

Hrm... weird enough, this is what my strace tells me (a symlink from /etc/my.cnf to /etc/mysql/my.cnf exists):

$ strace mysqldump 2>&1 | grep my.cnf
stat64("/etc/my.cnf", {st_mode=S_IFREG|0644, st_size=3959, ...}) = 0
open("/etc/my.cnf", O_RDONLY) = 3
stat64("/home/tkeller/.my.cnf", 0xbf8ccdb4) = -1 ENOENT (No such file or directory)
stat64("/usr/local/Zend/Core/etc/my.cnf", 0xbf8ccdb4) = -1 ENOENT (No such file or directory)

I have no idea why it looks for /usr/local/Zend/... (this directory path doesn't exist entirely), but if you say it works for you, its probably some weird local issue.

Revision history for this message
Andreas Olsson (andol) wrote :

@Thomas: Stange. With or without symlinks (tried both directions) I still get the same results as Mathias. I even tried with separate copies of /etc/my.cnf and /etc/mysql/my.cnf.

andol@pc13267:/etc$ strace mysqldump 2>&1 | grep my.cnf
stat("/etc/mysql/my.cnf", {st_mode=S_IFREG|0644, st_size=3894, ...}) = 0
open("/etc/mysql/my.cnf", O_RDONLY) = 3
stat("/home/andol/.my.cnf", 0x7fff7e12d8e0) = -1 ENOENT (No such file or directory)
stat("/usr/etc/my.cnf", 0x7fff7e12d8e0) = -1 ENOENT (No such file or directory)

The /usr/local/Zend/ does make me wonder. Are you sure you are actually running the mysqldump belonging to the Ubuntu package? What will "which mysqldump" tell you? What happens if you do the same strace on an explicit /usr/bin/mysqldump?

This is what Google tells me when I ask about "/usr/local/Zend"; http://www.zend.com/. Does that ring any bell?

By the way, mysql-client-5.0.51a-3ubuntu5.1 is almost a year old. Current version in Ubuntu 8.04 is 5.0.51a-3ubuntu5.4.

Revision history for this message
Thomas (me-thomaskeller) wrote :

Ok guys, sorry for the noise. It was indeed this stupid Zend code thing which was once installed on this server (and got not cleanly uninstalled later on), this thread points to the solution:

http://ubuntuforums.org/showthread.php?t=876252

I guess one cannot do anything on Debian's / Ubuntu's side to issue a warning, but hey, at least you're now aware of the issue ;)

Thanks again for your time,
Thomas.

Mathias Gug (mathiaz)
Changed in mysql-dfsg-5.0:
status: Incomplete → Invalid
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.