ITPub博客

首页 > 数据库 > MySQL > MySQL 多实例启动和关闭脚本

MySQL 多实例启动和关闭脚本

原创 MySQL 作者:haoge0205 时间:2014-04-02 14:12:51 0 删除 编辑

DB: 5.5.14

OS:CentOS 6.3

在MySQL多实例中,一个一个启动灰常麻烦,因此写个简单的启动和关闭脚本


启动脚本:start.sh

#!/bin/bash

for port in {3390..3396}

do

(/export/servers/mysql/bin/mysqld_safe --defaults-file=/export/servers/mysql/etc/my$port.cnf  ) &

done


关闭脚本:stop.sh

#!/bin/bash

for port in {3390..3396}

do

(/export/servers/mysql/bin/mysqladmin -uroot -p  -S /export/data/mysql/tmp/mysql$port.sock  shutdown) &

done

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28939273/viewspace-1134602/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-28

  • 博文量
    300
  • 访问量
    1893836