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 <[email protected]>"
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
?
safe_mysqld
was removed.mysqld_safe
is still the recommended way to runmysql
according to the 5.6 documentation.mysqld
was running thenmysqld_safe
.mysql
was running, but I've only discovered this because ourmysqld
process is crashing, and not restarting. So maybe they're wrong?