要找出mysqld的启动命令(使用Mac),我可以这样做:
ps aux|grep mysql
我得到以下输出,这使我可以启动mysql服务器。
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=...
我如何找到必要的命令以从命令行停止mysql?
尝试:
/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,则 可以尝试:
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