Red Hat Bugzilla – Bug 112829
/etc/init.d/mysqld start fails but mysql is alive
Last modified: 2007-11-30 17:10:35 EST
Description of problem:
The script /etc/init.d/mysqld fail testing for mysql alive if the DB
is password protected.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. /etc/init.d/mysqld stop
2. /etc/init.d/mysqld start
[root@localhost root]# /etc/init.d/mysqld stop
Interruzione di MySQL: [ OK ]
[root@localhost root]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Avvio di MySQL: [FALLITO]
Avvio di MySQL: [ OK ]
if your mysql-root has a password you have to change the user for
"mysqladmin ping" "-u none-mysql-existing-user"
$ grep mysqladmin /etc/init.d/mysqld
# if [ -n "`/usr/bin/mysqladmin ping 2> /dev/null`" ]; then
if [ -n "`/usr/bin/mysqladmin -unobody ping 2> /dev/null`"
# if !([ -n "`/usr/bin/mysqladmin ping 2> /dev/null`" ]); then
if !([ -n "`/usr/bin/mysqladmin -unobody ping 2>
/dev/null`" ]); then
I have done the changes, all is ok. Could I ask you why the command
must be " /usr/bin/mysqladmin ping 2> /dev/null " instead of = "
/usr/bin/mysqladmin ping > /dev/null " ?
In other words why 2 ? ( I am non a bash guru ( and also not a guru at
all )) :-) ( from command line /usr/bin/mysqladmin ping result ok ;
/usr/bin/mysqladmin ping 2 result in error ).
perhaps should only the error(2) be redirected to /dev/null
$ mysqladmin ping 2 > /dev/null
and not the error_or_output
$ mysqladmin ping > /dev/null 2>&1
$ man bash
/redirection /dirlist /2>&1
1 = standard output
2 = standard error
i do not understand why this part "spin for a maximum of ten seconds
..." is in the mysqld-init-script or why it expect that the
mysql-root has no password.
afair it appeared the first time in fedora-test and is imho not necessary.
i had no problems with redhat mysqld-init-scripts since rhl 7.x
The looping change was put in as a fix for bug #58372 in October 2003.
Glad you fixed your problem. There is an updated init script which
points out that you may need to change the mysqladmin ping line.
Is fixed package available? Damn annoying bug :)