List:General Discussion« Previous MessageNext Message »
From:Zhou Senqiang Date:October 2 1999 1:09pm
Subject:How to start mysql server when system reboot?
View as plain text  
Hi,
    I installed  mysql  Ver 9.32 Distrib 3.22.21, for pc-linux-gnu (i686) on
Linux 2.2.5.  Every time I reboot system I found the mysql has not been
started. But in the directory /etc/rc.d,  the file "mysql" exists.   How to
solve it?   Thanks a lot.  Followed is the content of the file "mysql":
#! /bin/sh


.. /etc/rc.config

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && START_MYSQL=yes
test "$START_MYSQL" = yes || exit 0

# The echo return value for success (defined in /etc/rc.config).    
return=$rc_done
case "$1" in
    start)
        if test ! -f /var/mysql/mysql/db.ISM ; then
                echo "Creating MySQL privilege database and starting MySQL."
                mysql_install_db || return=$rc_failed
                startproc /usr/bin/safe_mysqld || return=$rc_failed
                echo -e "$return"
        else
                echo "Starting service MySQL."
                # Start daemon with startproc(8). If this fails
                # the echo return value is set appropriate.

                # append the parameter "-l" to safe_mysqld ,
                # if you want logging.
                startproc /usr/bin/safe_mysqld || return=$rc_failed
                echo -e "$return"
        fi
        ;;
    stop)                 
   echo -n "Shutting down MySQL:"
        killproc -TERM /usr/sbin/mysqld || return=$rc_failed
        echo -e "$return"
        ;;
    restart|reload)
        echo -n "Restarting service MySQL."
        $0 stop  &&  $0 start  ||  return=$rc_failed
        echo -e "$return"
        ;;
    check|status)
        echo -n "Checking for service MySQL: "
        ## Check status with checkproc(8), if process is running
        ## checkproc will return with exit status 0.

        checkproc /usr/sbin/mysqld && echo OK || echo No process
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|check}"
        exit 1
        ;;
esac                             
# Inform the caller not only verbosely and set an exit status.
test "$return" = "$rc_done" || exit 1
exit 0  
Thread
How to start mysql server when system reboot?Zhou Senqiang2 Oct
  • Re: How to start mysql server when system reboot?Paul DuBois2 Oct
    • Re: How to start mysql server when system reboot?Sean O'Hara2 Oct