如何停止mysqld [英] How to stop mysqld

查看:116
本文介绍了如何停止mysqld的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要找出mysqld的启动命令(使用Mac),我可以这样做:

To find out the start command for mysqld (using a mac) I can do:

ps aux|grep mysql

我得到以下输出,这使我可以启动mysql服务器.

I get the following output, which allows me to start mysql server.

/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=...

我如何找到从命令行停止mysql的必要命令?

How would I find the necessary command to stop mysql from the command line?

推荐答案

尝试:

/usr/local/mysql/bin/mysqladmin -u root -p shutdown 

或者:

sudo mysqld stop

或者:

sudo /usr/local/mysql/bin/mysqld stop

或者:

sudo mysql.server stop

如果在OSX中安装 Launchctl ,则可以尝试:

If you install the Launchctl in OSX you can try:

sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql.plist

注意:这在重新启动后仍然存在.

Note: this is persistent after reboot.

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

二进制安装程序

sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart

我在以下位置发现了这一点: https://stackoverflow.com/a/102094/58768

I found that in: https://stackoverflow.com/a/102094/58768

这篇关于如何停止mysqld的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆