首页 >数据库 >mysql教程 >MySQL 多实例启动和停止脚本

MySQL 多实例启动和停止脚本

WBOY
WBOY原创
2016-06-07 17:12:511125浏览

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