Bug #75952 /usr/my.cnf not removed during old-style to new-style rpm upgrades
Submitted: 18 Feb 2015 12:18 Modified: 25 May 2016 17:13
Reporter: Ramana Yeruva Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Package Repos and Docker Images Severity:S3 (Non-critical)
Version:5.6.23 OS:Any
Assigned to: CPU Architecture:Any

[18 Feb 2015 12:18] Ramana Yeruva
Description:
install 5.6.23 old-style gpl rpms(ex:rhel5) and observe /usr/my.cnf created by default
install el5 commercial repo config file
replace old-style rpms using mysql56-commercial repo using update or install command
observe /usr/my.cnf still exists though new style rpms use /etc/my.cnf config to start server by default

How to repeat:
yum -y remove 'mysql*' 'MySQL*'
rm -rf /var/lib/mysql /etc/my.cnf /usr/my.cnf
[lroot@viking77 Ramana]# yum -y localinstall 5.6.23/gpl/MySQL-*.rpm<--lets finish installation and observe database created this step itself
Loaded plugins: security
Setting up Local Package Process
Examining 5.6.23/gpl/MySQL-client-5.6.23-1.rhel5.x86_64.rpm: MySQL-client-5.6.23-1.rhel5.x86_64
Marking 5.6.23/gpl/MySQL-client-5.6.23-1.rhel5.x86_64.rpm to be installed
Examining 5.6.23/gpl/MySQL-devel-5.6.23-1.rhel5.x86_64.rpm: MySQL-devel-5.6.23-1.rhel5.x86_64
Marking 5.6.23/gpl/MySQL-devel-5.6.23-1.rhel5.x86_64.rpm to be installed
Examining 5.6.23/gpl/MySQL-embedded-5.6.23-1.rhel5.x86_64.rpm: MySQL-embedded-5.6.23-1.rhel5.x86_64
Marking 5.6.23/gpl/MySQL-embedded-5.6.23-1.rhel5.x86_64.rpm to be installed
Examining 5.6.23/gpl/MySQL-server-5.6.23-1.rhel5.x86_64.rpm: MySQL-server-5.6.23-1.rhel5.x86_64
Marking 5.6.23/gpl/MySQL-server-5.6.23-1.rhel5.x86_64.rpm to be installed
Examining 5.6.23/gpl/MySQL-shared-5.6.23-1.rhel5.x86_64.rpm: MySQL-shared-5.6.23-1.rhel5.x86_64
Marking 5.6.23/gpl/MySQL-shared-5.6.23-1.rhel5.x86_64.rpm to be installed
Examining 5.6.23/gpl/MySQL-shared-compat-5.6.23-1.rhel5.x86_64.rpm: MySQL-shared-compat-5.6.23-1.rhel5.x86_64
Marking 5.6.23/gpl/MySQL-shared-compat-5.6.23-1.rhel5.x86_64.rpm to be installed
Examining 5.6.23/gpl/MySQL-test-5.6.23-1.rhel5.x86_64.rpm: MySQL-test-5.6.23-1.rhel5.x86_64
Marking 5.6.23/gpl/MySQL-test-5.6.23-1.rhel5.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package MySQL-client.x86_64 0:5.6.23-1.rhel5 set to be updated
---> Package MySQL-devel.x86_64 0:5.6.23-1.rhel5 set to be updated
---> Package MySQL-embedded.x86_64 0:5.6.23-1.rhel5 set to be updated
---> Package MySQL-server.x86_64 0:5.6.23-1.rhel5 set to be updated
---> Package MySQL-shared.x86_64 0:5.6.23-1.rhel5 set to be updated
---> Package MySQL-shared-compat.x86_64 0:5.6.23-1.rhel5 set to be updated
---> Package MySQL-test.x86_64 0:5.6.23-1.rhel5 set to be updated
--> Finished Dependency Resolution
;
;
;

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

[lroot@viking77 Ramana]# ls -lrt /usr/my.cnf 
-rw-r--r-- 1 root lroot 943 Feb 18 13:11 /usr/my.cnf

yum -y install mysql-commercial-release-el5-1.noarch.rpm
yum clean all
yum -y install 'mysql-commercial*'<--this will install 5.6-commercial packages

[lroot@viking77 Ramana]# ls /usr/my.cnf -lrt<--this still exists,which should have been removed
-rw-r--r-- 1 root lroot 943 Feb 18 13:11 /usr/my.cnf
[25 May 2016 17:13] Paul Dubois
Posted by developer:
 
Added the following text to:

  http://dev.mysql.com/doc/refman/5.7/en/linux-installation-rpm.html

 Installation of previous versions of MySQL using the older packages might
have created a configuration file named /usr/my.cnf.
It is highly recommended that you  examine the contents of the file and
migrate the desired settings inside to the
file /etc/my.cnf file, then remove /usr/my.cnf.