启动mysql时,需要指定此实例的配置文件:
/bin/sh ${CmdPath}/mysqld_safe --defaults-file=/data/${port}/my.cnf 2>&1 > /dev/null &
${CmdPath}:mysql的路径
${port}:此mysql实例的端口
关闭mysql时,需要指定此mysql的socket:
${CmdPath}/mysqladmin -u ${mysql_user} -p${mysql_pwd} -S /data/${port}/mysql.sock shutdown
${CmdPath}:mysql的路径
${port}:此mysql实例的端口
${mysql_user}:关闭mysql的用户名
${mysql_pwd}:关闭mysql的密码
转载于:https://blog.51cto.com/liuzhengwei521/1771682