Bug #71600 RPM installation generates /usr/my.cnf
Submitted: 6 Feb 2014 8:09 Modified: 30 Jul 2014 14:20
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.6.15, 5.6.16 OS:Any
Assigned to: CPU Architecture:Any
Tags: rpm

[6 Feb 2014 8:09] Daniël van Eeden
Description:
This might be a duplicate of Bug #68318.

mysql_install_db generates a my.cnf in basedir by default. As far as I understand it mysql_install_db was updated to allow installation if basedir is not writable. This however doesn't change anything in the situation with the RPM installation.

Placing a config file in /usr/my.cnf 
- Is not an expected location
- Seems to violate the FHS

Also the /usr/my.cnf file is not 'owned' by the RPM (rpm -qf /usr/my.cnf) while the missing /etc/my.cnf is owned by the package.

How to repeat:
Install mysql with RPMs and check the contents of /usr/my.cnf

Suggested fix:
Move the my.cnf to a more expected and FHS compliant location
[6 Feb 2014 18:35] Sveta Smirnova
Thank you for the report.

Which exact MySQL package do you use?
[6 Feb 2014 21:17] Daniël van Eeden
I use the 5.6.15 enterprise RPM for RHEL6 x86_64
[7 Feb 2014 20:04] Sveta Smirnova
Thank you for the feedback.

Verified as described. I have to run mysql_install_db manually after installing RPM.
[28 Feb 2014 7:45] Daniël van Eeden
Updated version and tags
[30 Jul 2014 16:39] Paul Dubois
Noted in 5.6.20 changelog.

By default, mysql_install_db creates a my.cnf file in the
installation base directory using a template. This may be
undesireable for some deployments. To enable this behavior to be
suppressed, mysql_install_db now supports a --keep-my-cnf option to
preserve any existing my.cnf file and not create a new my.cnf file.
[7 Aug 2014 6:53] Laurynas Biveinis
$ bzr log -n0 -r 6032
------------------------------------------------------------
revno: 6032
committer: Terje Rosten <terje.rosten@oracle.com>
branch nick: mysql-5.6-skip.my.cnf.ung
timestamp: Fri 2014-06-27 09:26:01 +0200
message:
  Bug#18205019: RPM INSTALLATION GENERATES /USR/MY.CNF
  
  A feature added to mysql_install_db in MySQL 5.6 was to generate my.cnf config file
  from template. The reason was a wish to set a specific value of sql_mode option
  for new installations. This is useful for many systems, however for some install
  methods and layouts this was not needed, and for some, even not wanted.
  
  Solution is add new option --keep-my-cnf to mysql_install_db.
  When used mysql_install_db will not generate my.cnf from template.
  
  
  Patch will also resolve issue mentioned in bug #68117 and #68318.