Onsql和MySQL的启停脚本(三)

2015-11-21 01:51:18 · 作者: · 浏览: 18
s -ef|grep mysqld|grep "$mysql_sock" |grep -vE 'grep|mysqld_safe'|awk '{print $2}'` if [ "0" = "$mysqld_pid"0 ] then echo "There is no mysqld process ! " else echo -e "\n" ps -ef|grep mysqld|grep "$mysql_cnf"|grep -v grep echo -e "MySQL(pid=$mysqld_pid) Status \n " #mysqladmin -S "$mysql_sock" status $MYSQL_HOME/bin/mysql -S "$mysql_sock" -e "\s;" echo -e "\n" fi } case "$1" in start) start ;; stop) stop ;; status) status ;; restart) stop start ;; *) echo "Usage:sh $0 {start|stop|restart|status}" esac exit [#11(zhouxx_vm(node3:192.168.56.103))#root@node3~]#