Home > Database > Mysql Tutorial > body text

MySQL 多实例启动和停止脚本

WBOY
Release: 2016-06-07 17:12:51
Original
1094 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template