Write your own MySQL startup script
Script one:
#!/bin/SH. /etc/init.d/functions[$#-ne1] && {Echo "Usage:{start|stop|restart}"Exit1}start () {if[-e/data/3307/Mysqld.pid] Then Echo "MySQL is running."Else/application/mysql/bin/mysqld_safe--defaults-file=/data/3307/MY.CNF &>/dev/NULL&Action"MySQL is starting"/bin/trueExit0fi}stop () {if[-e/data/3307/Mysqld.pid] Then/application/mysql/bin/mysqladmin-uroot-p123456-s/data/3307/mysql.sock shutdown &>/dev/NULLAction"MySQL is stoping"/bin/trueElseAction"MySQL is stoping"/bin/falseExit1fi}restart () {StopSleep 2Start}if[" $"=="Start" ] ThenStartelif[" $"=="Stop" ] ThenStopelif[" $"=="Restart" ] ThenRestartElse Echo "Usage:{start|stop|restart}" fi
Script two:
#!/bin/SH. /etc/init.d/functionsstart () {if[-e/data/3307/Mysqld.pid] Then Echo "MySQL is running."Else/application/mysql/bin/mysqld_safe--defaults-file=/data/3307/MY.CNF &>/dev/NULL&Action"MySQL is starting"/bin/trueExit0fi}stop () {if[-e/data/3307/Mysqld.pid] Then/application/mysql/bin/mysqladmin-uroot-p123456-s/data/3307/mysql.sock shutdown &>/dev/NULLAction"MySQL is stoping"/bin/trueElseAction"MySQL is stoping"/bin/falseExit1fi}restart () {StopSleep 2Start} Case$1 inchstart) Start; stop) stop;; restart) restart;; *) Echo "usage:$0 {Start|stop|restart}"Exit1Esac
MySQL startup script