How to start/stop MySQL server on Linux如何启动/停止MySQL服务器在Linux上
# To Start MySQL Server #启动MySQL服务器
/sbin/service mysqld start / sbin /服务mysqld启动
# To Stop MySQL Server #停止MySQL服务器
/sbin/service mysqld stop / sbin /服务mysqld停止
# To Restart MySQL Server #重新启动MySQL服务器
/sbin/service mysqld restart / sbin /服务重新启动mysqld
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元,因为我在`的PS -外汇基金| grep mysqld | awk ' (打印2元) ' ` ;做`杀死-9 10 。 ` ;做
Thanks to Anthony Eden for the comment (below) to remove the dot in front.感谢安东尼艾登为评论(见下文) ,以消除斑点在前面。
A simpler alternative is:一个较简单的办法是:
pkill mysqld pkill mysqld
This will kill the mysqld process.这将杀死mysqld进程。 However the best way to stop (because it stops properly) is obviously:不过,最好的办法阻止(因为它停止妥善) ,显然是:
/sbin/service mysqld stop / sbin /服务mysqld停止
Filed under提起下 Database数据库 , , Linux Linux的 , , RDBMS RDBMS的 , , Web Hosting虚拟主机 | |
| |
RSS 2.0 2.0 | |
Email this Article电子邮件此文章
You may also like to read您也可以想读 |




January 8th, 2005 at 12:21 pm 2005年1月8日在下午12时21分
I suggest you remove the .我建议你删除。 in front of the first slash so that you can execute that command from anywhere, not just in the / directory.在前面的第一个斜线,使您可以执行该命令从任何地方,而不只是在/目录。
February 2nd, 2005 at 4:41 am 2005年2月2日在上午04时41分
what about什么
# killall mysqld # killall mysqld
February 2nd, 2005 at 5:20 am 2005年2月2日在上午05时20分
Ortwin,奥尔特温,
Very true.非常真实。 killall can be used instead of the awkward awk code. killall可以用来代替尴尬awk代码。 I missed it because it is not on my Linux installation provided by my hosting provider.我没有因为这是不是对我的Linux安装,我所提供的托管服务提供商。
Thanks for the tip.感谢举报。
Angsuman由Angsuman
March 20th, 2005 at 8:31 pm 2005年3月20日在下午8时31分
very good非常好
March 31st, 2007 at 5:49 am 2007年3月31日在上午05时49分
hai angsuman ..well the tip you provided to start the SQL server isnt working .海由Angsuman ..好提示您提供的启动SQL Server isn't工作。
April 2nd, 2007 at 7:48 am 2007年4月2日在上午07时48分
You can also try these:您也可以试试这些:
service mysqld start启动mysqld服务
service mysqld stop服务mysqld停止
service mysqld restart服务重新启动mysqld
October 18th, 2007 at 5:06 am 2007年10月18日在上午05时06分
I tried the above one, but not able to stop!我尝试上述一,但无法停止!
October 18th, 2007 at 1:14 pm 2007年10月18日在下午1时14分
To stop just use:停止使用:
service mysqld stop 服务mysqld停止
November 27th, 2007 at 3:19 pm 2007年11月27日在下午3时19分
I tried /sbin/service mysqld stop我曾尝试/ sbin /服务mysqld停止
But faled.但faled 。 got response “mysqld: unrecognized service得到的回应“ mysqld :无法辨识的服务
“
November 27th, 2007 at 3:26 pm 2007年11月27日在下午3时26分
Got the way.得到的方式。 “service mysql stop” worked fine. “服务的MySQL一站式”工作的罚款。
But, please clarify the difference.但是,请澄清的差异。 I don’t know what is the difference.我不知道的区别是什么。
November 27th, 2007 at 8:22 pm 2007年11月27日在下午8时22分
No difference.没有区别。 The name of the mysqld executive may vary from one distribution to another and even between versions.的名称,该mysqld长官可能会有所不同,从一分配到另一个国家,甚至之间的版本。 On fedora core 6 it is mysqld.对的Fedora Core 6 ,这是mysqld 。 Which distro are you using?其中distro您使用的呢?
November 29th, 2007 at 7:48 pm 2007年11月29日在下午7点48分
Worked like a charm, many thanks!工作就像一个魅力,许多感谢!
June 11th, 2008 at 5:20 am 2008年6月11日在上午05时20分
Really this should be titled How to Stop Mysql Server on Redhat/Fedora.真的这应该是名为如何停止MySQL服务器在RedHat /浅顶软呢帽。 /sbin/service is a redhat-ism. / sbin /服务是一个Redhat的主义。 Its basically a wrapper script around the init.d scripts.其基本上是一个包装脚本周围init.d脚本。 Debian/Ubuntu users, and other based on SysV style init scripts (most I think maybe not SuSE) can do the same thing by invoking /etc/init.d/mysql stop as root which is what /sbin/service does.在Debian / Ubuntu的用户,和其他的基础上了sysv作风init脚本(最我认为也许不是的SuSE )可以做同样的事情,引用的/ etc / init.d / MySQL的停止,以root的身份,而这正是/ sbin /服务。