红联Linux门户
Linux帮助

How to start/stop MySQL server on Linux

发布时间:2007-12-11 01:42:59来源:红联作者:scriptaj
# To Start MySQL Server
/sbin/service mysqld start

# To Stop MySQL Server
/sbin/service mysqld stop

# To Restart MySQL Server
/sbin/service mysqld restart

And of course there is the brute force way to kill all the processes:
$ for i in `ps -ef |grep mysqld |awk ‘{print $2}’`; do `kill -9 $i`; done

Thanks to Anthony Eden for the comment (below) to remove the dot in front.

A simpler alternative is:
pkill mysqld

This will kill the mysqld process. However the best way to stop (because it stops properly) is obviously:
/sbin/service mysqld stop
文章评论

共有 0 条评论