首頁 >資料庫 >mysql教程 >MySQL 多实例启动和停止脚本

MySQL 多实例启动和停止脚本

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-06-07 17:12:511136瀏覽

mysql 多实例启动脚本: #!/bin/bash if [ $1 == ] (输入要停止的mysq端口号)then echo Please input mysqld GNR number 1

mysql 多实例启动脚本:

#!/bin/bash


if [ "$1" == "" ] (输入要停止的mysq端口号)
then
 echo "Please input mysqld GNR number 110-112"(这是开启的端口号范围)


elif ([ "$1" != "110" ] && [ "$1" != "111" ] && [ "$1" != "112" ])(匹配要关闭的端口号,,如果匹配成功就关闭掉响应的数据库实例)
then
 echo "Please input mysqld port number 110-112"


else
mysqld_multi --defaults-extra-file=/etc/my_multi.cnf start $1
fi
~        

mysql 多实例停止脚本:

#!/bin/bash


if [ "$1" == "" ]
then
 echo "Please input mysqld GNR number 110-112"


elif ([ "$1" != "110" ] && [ "$1" != "111" ] && [ "$1" != "112" ])
then
 echo "Please input mysqld port number 110-112"


else
mysqld_multi --defaults-extra-file=/etc/my_multi.cnf stop $1
fi

linux

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn