MySQL multi-instance Start and Stop scripts

Source: Internet
Author: User
Tags stop script

Mysql multi-instance STARTUP script:

#! /Bin/bash


If ["$1" = ""] (enter the mysq port number to stop)
Then
Echo "Please input mysqld GNR number 110-112" (this is the range of enabled port numbers)


Elif (["$1 "! = "110"] & ["$1 "! = "111"] & ["$1 "! = "112"]) (matches the port number to be closed, and closes the response database instance if the match is successful)
Then
Echo "Please input mysqld port number 110-112"


Else
Mysqld_multi -- defaults-extra-file =/etc/my_multi.cnf start $1
Fi
~

Mysql multi-instance stop script:

#! /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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.