MySQL代理的使用¶
MySQL脚本¶
1#!/bin/bash
2mode=$1
3if [ -z "$mode" ] ; then
4mode="start"
5fi
6case $mode in
7
8start)
9mysql-proxy --defaults-file=/etc/mysql-proxy.cnf>/usr/local/proxy-mysql/cn.log &
10;;
11
12stop)
13killall -9 mysql-proxy
14;;
15
16restart)
17if $0 stop ; then
18$0 start
19else
20echo "Restart failed!"
21exit 1
22fi
23;;
24esac
25exit 0