MySQL restart failure, but actully is running

Re: 啟動Mysql發生問題
Dear hsieh:

解決方法如下

修改 /etc/rc.d/init.d/mysqld

if [ $ret -eq 0 ]; then
for x in 1 2 3 4 5 6 7 8 9 10; do
if [ -n “`/usr/bin/mysqladmin ping 2> /dev/null`” ]; then
break;
else
sleep 1;
fi
done
if !([ -n “`/usr/bin/mysqladmin ping 2> /dev/null`” ]); then
echo “Timeout error occurred trying to start MySQL Daemon.”
action $”Starting $prog: ” /bin/false
else
action $”Starting $prog: ” /bin/true
fi
else
action $”Starting $prog: ” /bin/false
fi

將以上兩個 ping 的後面各加上 -u

if [ $ret -eq 0 ]; then
for x in 1 2 3 4 5 6 7 8 9 10; do
if [ -n “`/usr/bin/mysqladmin ping -u 2> /dev/null`” ]; then
break;
else
sleep 1;
fi
done
if !([ -n “`/usr/bin/mysqladmin ping -u 2> /dev/null`” ]); then
echo “Timeout error occurred trying to start MySQL Daemon.”
action $”Starting $prog: ” /bin/false
else
action $”Starting $prog: ” /bin/true
fi
else
action $”Starting $prog: ” /bin/false
fi

這樣就可以了.

歷史上得今天..

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image