[文章作者:张宴 本文版本:v1.0 最后修改:2008.07.24 转载请注明原文链接:http://blog.zyan.cc/post/359/]
写了一个shell脚本,可以在同一台Linux服务器的不同端口,运行多个MySQL服务的情况下,快捷启动、停止、重启、杀死指定端口的MySQL进程。
输入以下内容(因各服务器的MySQL配置不同,可能需要修改的部分已用红色标注):
赋予脚本可执行权限:
脚本执行方法:
写了一个shell脚本,可以在同一台Linux服务器的不同端口,运行多个MySQL服务的情况下,快捷启动、停止、重启、杀死指定端口的MySQL进程。
vi /usr/local/bin/mysql.sh
输入以下内容(因各服务器的MySQL配置不同,可能需要修改的部分已用红色标注):
#!/bin/sh
mysql_port=$2
mysql_username="root"
mysql_password="123456"
function_start_mysql()
{
printf "Starting MySQL...\n"
/bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}
function_stop_mysql()
{
printf "Stoping MySQL...\n"
/usr/local/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -h localhost -P ${mysql_port} shutdown
}
function_restart_mysql()
{
printf "Restarting MySQL...\n"
function_stop_mysql
function_start_mysql
}
function_kill_mysql()
{
kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
}
if [ "$1" = "start" ]; then
function_start_mysql
elif [ "$1" = "stop" ]; then
function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
printf "Usage: mysql.sh {start|stop|restart|kill}\n"
fi
mysql_port=$2
mysql_username="root"
mysql_password="123456"
function_start_mysql()
{
printf "Starting MySQL...\n"
/bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/mysql/${mysql_port}/my.cnf 2>&1 > /dev/null &
}
function_stop_mysql()
{
printf "Stoping MySQL...\n"
/usr/local/mysql/bin/mysqladmin -u ${mysql_username} -p${mysql_password} -h localhost -P ${mysql_port} shutdown
}
function_restart_mysql()
{
printf "Restarting MySQL...\n"
function_stop_mysql
function_start_mysql
}
function_kill_mysql()
{
kill -9 $(ps -ef | grep 'bin/mysqld_safe' | grep ${mysql_port} | awk '{printf $2}')
kill -9 $(ps -ef | grep 'libexec/mysqld' | grep ${mysql_port} | awk '{printf $2}')
}
if [ "$1" = "start" ]; then
function_start_mysql
elif [ "$1" = "stop" ]; then
function_stop_mysql
elif [ "$1" = "restart" ]; then
function_restart_mysql
elif [ "$1" = "kill" ]; then
function_kill_mysql
else
printf "Usage: mysql.sh {start|stop|restart|kill}\n"
fi
赋予脚本可执行权限:
chmod +x /usr/local/bin/mysql.sh
脚本执行方法:
mysql.sh start 3306
mysql.sh stop 3306
mysql.sh restart 3306
mysql.sh kill 3306
mysql.sh stop 3306
mysql.sh restart 3306
mysql.sh kill 3306
start)
function_start_mysql
;;
stop)
function_stop_mysql
;;
restart)
function_restart_mysql
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
试试改成这样
http://bbs.woyool.com
Here are some tips to distinguish real and fake Gucci shoes:
1. Real Gucci shoes have eight digit serial numbers. You can see it in the inside leather lining of the shoe. In the real Gucci shoes also have stamp “Gucci Made in Italy“. The stamp is located in the heel of the shoe.
2. You should check the little details. Real Gucci shoe soles are made from leather, while the fake Gucci shoes made from synthetic material. If you want to make sure,Converse Pas cher, go to the Gucci store to check out the details of real Gucci shoes.
3. Should pay attention to packaging. Real Gucci shoes packaging usually use a box and a shoe bag. Gucci shoe bags are brown and have logo” G “, the logo is printed in the bag. Gucci shoe box are dark brown with the word ” GUCCI ” and written in silver letters. To make sure, you can look at the official website Gucci or Gucci store.
4. Real Gucci shoes made from high quality leather and very soft material. While the fake Gucci made with cheaper material and rough material. Real Gucci shoes must prone to scuff. Real leather material has a different smell.
5. Gucci shoes are usually expensive. If you buy Gucci shoes at a cheap price so you should be careful to make sure that the shoes are real or fake.
ADVERTISEMENT
burberry uk
ralph lauren uk
tiffanys
gucci uk
louis vuitton sac