mac上启动和停止mysql

  因调试需要,在mac上安装了mysql,安装方法网上大把,此处不赘述。启动和停止命令每次要手工敲,因此写个小脚本方便自己:

startmysql.sh(/Applications/Develop/mysql-5.6.24为mysql的安装目录):

cd /Applications/Develop/mysql-5.6.24
./bin/mysqld_safe&

stopmysql.sh

kill -9 `ps -ef | grep mysqld_safe| grep -v grep| awk '{print $2}'`
kill -9 `ps -ef | grep 'mysqld' | grep -v grep| awk '{print $2}'`

posted @ 2015-12-19 22:19  badwood  阅读(434)  评论(0编辑  收藏  举报
Badwood's Blog