6 [ -r /etc
/default
/mysql
] && .
/etc
/default
/mysql
10 if [ ! -d $MYSQL_DIR/mysql
] ; then
11 echo "Creating MySQL system tables..."
12 mysql_install_db
--user=$MYSQL_USER --ldata=$MYSQL_DIR
15 # mysqld runs as user mysql, but /run is only writable by root
16 # so create a subdirectory for mysql.
17 install -d -o mysql
-g root
-m 0755 /run
/mysql
19 # We don't use start-stop-daemon because mysqld has
20 # its own wrapper script.
21 printf "Starting mysql..."
22 /usr
/bin
/mysqld_safe
--pid-file=/run
/mysql
/mysqld.pid
&
26 printf "Stopping mysql..."
27 if test -f /run
/mysql
/mysqld.pid
; then
28 kill `cat /run/mysql/mysqld.pid`
37 echo "Usage: /etc/init.d/mysqld {start|stop|restart}"