Bug #60729 mysqld startup should NOT parse ~/.my.cnf for [mysqld] entries
| Submitted: | 2 Apr 2011 5:31 | Modified: | 2 Apr 2011 8:41 |
|---|---|---|---|
| Reporter: | Simon Mudd | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: General | Severity: | S2 (Serious) |
| Version: | 5.1 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | [mysqld], ~/my.cnf, mysqld, startup, windmill | ||
[2 Apr 2011 5:31]
Simon Mudd
[2 Apr 2011 7:56]
Valeriy Kravchuk
What you ask for makes sense, but as current behavior is described and intended, all items (but more clear error message, maybe) are feature requests. We should consider them for 5.6+, but for already released GA versions these changes are hardly possible. Users may rely on ~/.my.cnf usage by all MySQL programs, as documented.
[2 Apr 2011 8:41]
Simon Mudd
Thanks for replying rapidly on this. I understand the desire to not change GA version (hence 5.1 or 5.5). Changing the behaviour in 5.6 (to at least _not_ read the ~/.my.cnf file) would be a reasonable change I believe. Also noted at least for mysql client behaviour while much of the documentation mentions ~/.my.cnf it seems the actual implementation of finding this location is by using $HOME, and not looking up the user's home directory via /etc/passwd or the appropriate system call. That can be confusing as many system set $HOME to / on boot up (I've seen this in Linux) and so mysql clients (and maybe the server don't look in the root user's home directory. Perhaps this behavoiur should be clarified in the documentation as client side behaviour from init created daemons (like puppet) can be behave unexpectedly in these conditions.
[28 May 2021 9:17]
Banzuki Boffo
This documented behaviour in 5.7 is actually causing me problems because ~/.my.cnf *isn't* (apparently) being read. I thought that this would be a good place to make system specific configuration (but was since discouraged by general confusion on irc://#mysql)
I have a .my.cnf file with a [mysqld] stanza under both /root/.my.cnf and (newly created) /home/mysql/.my.cnf, but neither location seems to be picked up:
$ ll /root/.my.cnf /home/mysql/.my.cnf
-rw-r--r-- 1 mysql mysql 226 5월 27 23:04 /home/mysql/.my.cnf
-rw-r--r-- 1 root root 226 5월 28 18:15 /root/.my.cnf
$ grep mysql /etc/passwd
mysql:x:123:128:MySQL Server,,,:/home/mysql:/bin/bash
So not only is this almost certainly a bad idea, it doesn't even work as documented (unless I'm doing something wrong).
Many thanks,
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.056 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.