แก้ปัญหา mysql error fedora core1 plesk6
Here's the start() from my "/etc/rc.d/init.d/mysqld" file (running version 3.23.58-4)
start(){
touch /var/log/mysqld.log
chown mysql.mysql /var/log/mysqld.log
chmod 0640 /var/log/mysqld.log
if [ ! -d $datadir/mysql ] ; then
action $"Initializing MySQL database: " /usr/bin/mysql_install_db
ret=$?
chown -R mysql.mysql $datadir
if [ $ret -ne 0 ] ; then
return $ret
fi
fi
chown -R mysql.mysql $datadir
chmod 0755 $datadir
/usr/bin/safe_mysqld --defaults-file=/etc/my.cnf >/dev/null 2>&1 &
ret=$?
# Spin for a maximum of ten seconds waiting for the server to come up
if [ $ret -eq 0 ]; then
psa_pass=`cat /etc/psa/.psa.shadow`
for x in 1 2 3 4 5 6 7 8 9 10; do
if [ -n "`/usr/bin/mysqladmin -uadmin -p$psa_pass ping 2> /dev/null`" ]; then
break;
else
sleep 1;
fi
done
if !([ -n "`/usr/bin/mysqladmin -uadmin -p$psa_pass 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
[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
return $ret