标签:enter shu .sh mysqld .so cal word dmi admin
#!/bin/bash
m_user=‘mt_user‘
m_password=‘abcd123‘
if [ "$1" == "start" ];then
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql"$2"/my.cnf &
elif [ "$1" == "stop" ];then
/usr/local/mysql/bin/mysqladmin -u"$m_user" -p"$m_password" -S /tmp/mysql"$2".sock shutdown
else
printf ‘Please enter start+port or stop+port‘
fi
启动
sh /sh/mt_mysql.sh start 3306
sh /sh/mt_mysql.sh start 3316
关闭
sh /sh/mt_mysql.sh stop 3306
sh /sh/mt_mysql.sh stop 3316
标签:enter shu .sh mysqld .so cal word dmi admin
原文地址:http://www.cnblogs.com/hmysql/p/7140662.html