Bug #18910 MySQL won't start automatically FC5 after upgrade from FC4 and MySQL 4 -> 5
Submitted: 8 Apr 2006 16:27 Modified: 13 Jun 2006 13:48
Reporter: Bernardino Lopez Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.7-beta OS:Linux (FC5)
Assigned to: CPU Architecture:Any

[8 Apr 2006 16:27] Bernardino Lopez
Description:
Running Fedora Linux Core 4 [ FC4 ] with MySQL_4_1_16_1. Run just great.

After I decide to upgrade Linux from FC4 to FC5. the upgrade run smooth, however noticed a problem with MySQL. did no want to start properly. Said that couldn't find the server.

I decide maybe good time to upgrade to MySQL 5.1.7-beta. So I download the RPM's and installed.

[root@announcefree MySQL]# mysql -udino -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.1.7-beta

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select version();
+------------+
| version()  |
+------------+
| 5.1.7-beta |
+------------+
1 row in set (0.01 sec)

=> The problem now is that the Regular Shell Script for start/stop only work unde some circunstances:

/etc/rc.d/init.d/mysql

If MySQL is not running won't start:
[root@announcefree MySQL_5_1_7]# /etc/rc.d/init.d/mysql start
Starting MySQL...................................          [FAILED]

After troubleshooting for a while found on the forums the recomendation to sun with more information parsing the /bin/sh -x /etc/rc.d/init.d/mysql start then noticed that it worked.

[root@announcefree MySQL_5_1_7]# sh /etc/rc.d/init.d/mysql start
Starting MySQL                                             [  OK  ]

I wonder if there is something wrong with the script or the permisions of the execution in the OS the forum said something about SE-Linux.

=> Once running the script can shutdown properly. just as expected.

[root@announcefree MySQL_5_1_7]# /etc/rc.d/init.d/mysql stop
Shutting down MySQL..                                      [  OK  ]

Please Advise.

How to repeat:
Upgrade from Fedora Core 4 to Fedora Core 5 and the MySQL Upgrade will failed. only the server MySQL 5.0 will be installed but won't start.

Try to upgrade manually with the rpm all the files and the MySQL Server will not start. not sure if is due to the MySQL version or the SE-Linux on Fedora Core 5.

The server can start manually with the safe_mysqld and putting the /bin/sh environment variable at the time of execution.
# sh /etc/rc.d/init.d/mysql start

Perhaps some tweaking on permisions on the File System or the Script.

Suggested fix:
Just to make it work:

# sh /etc/rc.d/init.d/mysql start

But can't run from the /etc/rc.local.. seems like the permision require the OS Start Completely.
[26 Apr 2006 14:12] Warwick Shaw
Before installing Mysql disable selinux  ( SELINUX=disabled )

/etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted
[12 May 2006 9:10] Valeriy Kravchuk
Please, try to repeat with SELinux disabled (as suggested) and newer version, 5.1.9-beta. Inform about the results.
[12 Jun 2006 23: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".
[13 Jun 2006 13:48] Bernardino Lopez
I do not want to disable SE-Linux. once disabled take to much time to re-activate. I believe I can live with my shell script to start MySQL with the properly environment variables even with SELinux enabled.

Will look closer for future updates, perhaps on future releases this could be fixed in a proper way.

Best Regards Dino.
[15 Jun 2006 9:43] Joerg Bruehe
Could the problem be related to bug#18810, wrong startup sequence ?
A fix for that will be published in 5.1.12-beta,
but you can also look at the patch yourself and modify the "/etc/init.d/mysql" startup file:

 ### BEGIN INIT INFO
 # Provides: mysql
 # Required-Start: $local_fs $network $remote_fs
+# Should-Start: ypbind nscd ldap ntpd xntpd
 # Required-Stop: $local_fs $network $remote_fs
 # Default-Start:  2 3 4 5
 # Default-Stop: 0 1 6