How to start and stop MySQL automatically.

1). Create a new file "/etc/rc.d/init.d/mysql" with the following content:

#!/bin/sh
# description: Start and Stop MySQL
# chkconfig: 2345 99 00

case "$1" in
'start')
/usr/local/mysql/bin/safe_mysqld --user=mysql &
touch /var/lock/subsys/mysql
;;
'stop')
killall -9 mysqld
rm -f /var/lock/subsys/mysql
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0

2). Make the file executable:

$> chmod 755 /etc/rc.d/init.d/mysql

3). Copy the file to several other init directories:

$> cp /etc/rc.d/init.d/qpopper /etc/rc.d/rc2.d/S99mysql
$> cp /etc/rc.d/init.d/qpopper /etc/rc.d/rc3.d/S99mysql
$> cp /etc/rc.d/init.d/qpopper /etc/rc.d/rc5.d/S99mysql

You can now start and stop Qpopper with the following commands

$> /etc/rc.d/init.d/mysql start
$> /etc/rc.d/init.d/mysql stop

and MySQL will start automatically when you boot RH Linux.

Related:
How to compile MySQL from source on Red Hat Linux
Tripanel tutorials index

Reference:
Eudora's Qpopper Website
Red Hat Linux Website


 
  Visit Noc2 Scripts and Software