Bug #68318 mysql_install_db creates my.cnf in /usr/
Submitted: 8 Feb 2013 23:35 Modified: 13 Feb 2013 9:20
Reporter: Andrew Garner Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.6.10 OS:Linux (RHEL5)
Assigned to: Balasubramanian Kandasamy CPU Architecture:Any

[8 Feb 2013 23:35] Andrew Garner
Description:
Using the MySQL Community RPMs for Redhat Enterprise Linux 5 from dev.mysql.com, mysql_install_db creates a spurious my.cnf in an odd location, /usr/my.cnf.   There is no way to disable this behavior.  Further, If running with an unprivileged user, mysql_install_db simply fails with an error and there is no way to run mysql_install_db as an unprivileged user.

How to repeat:
1) As a privileged user:

# mysql_install_db --defaults-file=/etc/my.cnf --datadir=$PWD/foo --user=mysql

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

2) As an unprivileged user
$ mysql_install_db --defaults-file=/etc/my.cnf --datadir=$PWD/foo --user=mysql 
FATAL ERROR: 

Suggested fix:
I do not think this is good default behavior, but if a my.cnf must be generated perhaps place it in ${datadir}.  I suggest providing a way to disable this behavior entirely.
[13 Feb 2013 9:20] Balasubramanian Kandasamy
Duplicate of Bug#68117.

Thanks,
[9 May 2014 10:04] Terje Røsten
See also bug#71600.