Bug #15865 /etc/init.d/mysql does not start mysqld at system start up
Submitted: 19 Dec 2005 18:15 Modified: 28 Aug 2013 2:32
Reporter: Peter Lee Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:4.1.10a OS:Linux (Linux Fedora Core 4)
Assigned to: CPU Architecture:Any

[19 Dec 2005 18:15] Peter Lee
Description:
I'm running Fedora Core 4.  mysqld was not started after a normal system boot.

After system start up, from a shell window, running 
    # /etc/init.d/mysql start
by hand from the command line does not start mysqld either.

I've tried various things like setting SELinux to Permissive, changing directory group ownerships, etc. None of them work.

However, if I do this from a shell:
    # /bin/bash /etc/init.d/mysql start
mysqld will start properly.

Has anyone encountered similar problem? 

How to repeat:
Boot Linux.

Run mysql (client) and it will not be able to get a connection.  See /var/lib/mysql and there's no sign of a running mysqld.
[19 Dec 2005 19:02] Aleksey Kishkin
Peter, could you write here output of

ls -al /etc/init.d/mysql
?
[19 Dec 2005 19:24] Peter Lee
# ls -al /etc/init.d/mysql
-rwxr-xr-x  1 root root 5582 Dec 19 10:06 /etc/init.d/mysql
[21 Dec 2005 11:53] Valeriy Kravchuk
Startup scripts are changing from time to time, and your 4.1.10a is really old. 

So, can you, please, try to install newer, 4.1.16 version's RPM and check if that script works in it?
[21 Dec 2005 12:09] Lenz Grimmer
Two things:

 - is there an /etc/my.cnf file by change? It may be a leftover from the original Fedora MySQL package. If you have not modifed it yet, try to remove it. Alternatively, edit it and remove the line "basedir=/var/lib" that is included in there.
 - Try to get some more debug output by running "sh -x /etc/init.d/mysql start". This should give us a better hint on where it fails to start.
[22 Jan 2006 0: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".
[30 Jan 2006 14:37] [ name withheld ]
Hi,

I have a similar problem. "sh /etc/init.d/mysql start" works, but "/etc/init.d/mysql start", doesn't. Also:

[root@localhost ~]# bash /etc/init.d/mysql start
Starting MySQL/etc/init.d/mysql: line 151: log_success_msg: command not found

(but the server is started, as far as I can see, correctly).

It's just a clean install of MySQL-server-standard-5.0.18-0.rhel4.i386.rpm,

[root@localhost ~]# ls /etc/my.cnf
ls: /etc/my.cnf: No such file or directory

Kind regards,

Alex
[25 Feb 2006 4:42] Dave Pullin
selinux stops mysql starting.
Try
/usr/sbin/setenforce Permissive
before you 
/etc/init.d/mysql
[25 Feb 2006 4:49] Dave Pullin
With MySQL V5.0.18 RPM-installed on Fedora Core 4 (replacing MySQL V4),

 /etc/init.d/mysql fails with "Couldn't find the server or manager"

I worked around the problem by using the /etc/init.d/mysql from V4, which seems to work fine with V5.

(You still need to set selinux to permissive because there's some security rule that prevents MySQL starting.)
[8 Oct 2009 15:51] Abhishek Kumar
Hi, I am also having the same problem on MySQL 5.1.37 GA. When I run "/etc/init.d/mysql start" from bash mysqld fails to start, with error "Manager of pid-file quit without updating file."
But if I run "sh /etc/init.d/mysql start" the service starts successfully. I have checked the permissions of all directories and files, but could not find anything wrong. Any pointers would be appreciated.
[27 Apr 2012 9:15] suma latha
Hi,
I am using mysql 5 on linux SUSE.

When i try to stop mysql from /etc/init.d it stops service properly.
When i try to start service it shows following warning but mysql is starting and working fine.

./mysql: line232: ./mysql: No such file or directory

what changes are required to solve this warning?

I googled for this issue,but i didn't find proper solution.
socket path is set to "/var/lib/mysql/mysql.sock".

any ideas please suggest
[28 Apr 2012 13:40] Valeriy Kravchuk
All reporters,

Please, make sure you use recent supported versions (5.1.62+ or 5.5.23+) and MySQL binaries from Oracle before re-opening this bug with additional comments. Even better, please, report a new bug if you still see this problem with recent versions.
[29 May 2012 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".
[25 Jun 2013 18:14] Joffrey MICHAIE
Hi,

Same issue found on MySQL 5.5.31 with Redhat Enterprise Linux 6.4

the problem  happens on Redhat with SElinux.

When you change the datadir, you need to change the permissions on SElinux so mysql can open the log files in the right directory. But nobody will think about this first, and will get the issue.

Question is why SElinux is not enforced when you do :
# sh /etc/init.d/mysql start
while it does when you do:
# /etc/init.d/mysql start
or
# service mysql start

Strace, sh -x and other outputs do not show any environnment variable difference. 

Maybe a SELinux bug ?

Joffrey
[29 Aug 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".