一尘不染

如何停止mysqld

mysql

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

ps aux|grep mysql

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

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

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


阅读 1731

收藏
2020-05-17

共1个答案

一尘不染

尝试:

/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,则 可以尝试:

MacPorts

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

注意:重新启动后,此设置将持续存在。

家酿

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

2020-05-17