I've installed mysql
on Ubuntu, and the documentation on starting it up says:
Invoke mysql.server. This script is used primarily at system startup and shutdown on systems that use System V-style run directories (that is, /etc/init.d and run-level specific directories), where it usually is installed under the name
mysql
. The mysql.server script starts the server by invoking mysqld_safe.
However, the mysql
file in /etc/init.d
is simply linked to /lib/init/upstart-job
, and the mysql.conf
file in /etc/init
is this:
# MySQL Service
description "MySQL Server"
author "Mario Limonciello <superm1@ubuntu.com>"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
respawn
respawn limit 2 5
env HOME=/etc/mysql
umask 007
# The default of 5 seconds is too low for mysql which needs to flush buffers
kill timeout 300
pre-start script
#Sanity checks
[ -r $HOME/my.cnf ]
[ -d /var/run/mysqld ] || install -m 755 -o mysql -g root -d /var/run/mysqld
/lib/init/apparmor-profile-load usr.sbin.mysqld
LC_ALL=C BLOCKSIZE= df --portability /var/lib/mysql/. | tail -n 1 | awk '{ exit ($4<4096) }'
end script
exec /usr/sbin/mysqld
post-start script
for i in `seq 1 30` ; do
/usr/bin/mysqladmin --defaults-file="${HOME}"/debian.cnf ping && {
exec "${HOME}"/debian-start
# should not reach this line
exit 2
}
statusnow=`status`
if echo $statusnow | grep -q 'stop/' ; then
exit 0
elif echo $statusnow | grep -q 'respawn/' ; then
exit 1
fi
sleep 1
done
exit 1
end script
I have two questions:
- Is the documentation wrong?
- How can I configure
mysql
to start undermysqld_safe
?
Best Answer
Currently, mysqld_safe is part of MySQL 5.5. I cannot speak for Ubuntu-specific things.
First, find out if mysqld_safe is present and accessible. Run this:
If it returns with the absolute path to the mysqld_safe program such as
then you could replace
with
Then,
service mysql start
.Please do this on a Dev/Staging server first. For emphasis, I cannot speak for Ubuntu.