Bug #66919 install_db isn't ran in RPM installation if /var/lib/mysql exists
Submitted: 21 Sep 2012 19:04 Modified: 14 Jan 2013 19:21
Reporter: Ryan Dyer Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.5.27-1 OS:Linux (CentOS5.6)
Assigned to: CPU Architecture:Any

[21 Sep 2012 19:04] Ryan Dyer
Description:
When using an RPM to install mysql, if you have created a /var/lib/mysql directory prior to installation (it's a partition in our case), the mysql_install_db script is not ran. 

The pre-script of the RPM does a check for /var/lib/mysql and outputs "MySQL RPM upgrade" to the STATUS_FILE.

The post-script in turn checks to see if "MySQL RPM upgrade" exists in STATUS_FILE in order to run mysql_install_db. 

How to repeat:
Create a /var/lib/mysql directory prior to installation of RPM.
Install RPM.
Note that the /var/lib/mysql/mysql directory is empty indicating that the install_db script didn't run.

Suggested fix:
I believe the check for the existance of /var/lib/mysql is not a sufficient check to say whether or not this is a new install or an upgrade.  The post install checks /var/lib/mysql/mysql in order to determine whether or not this is a new or upgrade installation.  The pre-install should probably also utilize that directory for proper checking.
[24 Sep 2012 23:46] Miguel Solorzano
Which package are you tried to install?. Thanks.
[25 Sep 2012 18:26] Ryan Dyer
MySQL-server-advanced-5.5.27-1.rhel5.x86_64.rpm
[22 Oct 2012 14:40] Steve Soutar
I have the same behaviour on a new Centos 6.3 installation, installing mysql Ver 14.14 Distrib 5.1.61, for redhat-linux-gnu (x86_64)

My installation script had a problem while configuring mysql, so I rolled back, uninstalled mysql, fixed the script & ran it again. Because the /var/lib/mysql directory was present, it was not possible to re-install mysql until I found this article.
[14 Dec 2012 19:21] Sveta Smirnova
Thank you for the feedback.

I don't see any advanced package on our download site. Where did you download this package? Please send us a link.
[15 Jan 2013 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".