问题
I'm starting to go nuts over this. I setup MySQL/Apache/PHP using the tutorial by Coolest Guides On The Planet. I'm guessing something went wrong as its not working as expected so I want to uninstall and try again.
The trouble is that I can't stop MySQL either by system preferences or command line. I keep trying suggestions on the net but so far unsuccessful. Can anyone help?
回答1:
Finally got around the autostart - Thanks to all who contributed and allowed me to see the way.
To stop the auto start I used:
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist
And to kill the service I used:
sudo pkill mysqld
回答2:
This is what worked for me. It was listed under a different plist name:
sudo launchctl unload -w com.oracle.oss.mysql.mysqld.plist
回答3:
For Mac Users kill -9 {pid} kept restarting the process. This was because I had MySQL Server running. On OSX I had to:
1- System Preferences.
2- Search for mysql.
3- Press the Stop MySQL Server button.
got it from a github issue, and it solved my problem
https://github.com/docker/compose/issues/4950#issuecomment-407145733
回答4:
in terminal
kill `pgrep mysqld`
this kills the mysqld process.
回答5:
I also got the same problem, unable to stop MySql Sever through system preferences on macOS High Sierra.
I did brew uninstall mysql
on my terminal window.
now I am able stop stop MySql Sever through system preferences.
Since mysql was installed on my mac 2 ways binary as well as home brew.
回答6:
brew services stop mysql@5.6
worked for me, when all else failed.
回答7:
Try with issuing the following command in command line:
ps -xo pid,ppid,stat,command | grep mysqld
It will show you your processes, with their parent ID in the second column. Look for the mysqld and it's parent process. After locating it, issue a:
sudo kill pid
where pid is mysqld's parent process ID.
EDIT If you want to stop the process from launching again, try:
sudo launchctl unload /System/Library/LaunchDaemons/mysqld.plist
回答8:
If you used brew
then you can find out which version you are using by:
launchctl list|grep mysql
this will print something like
92555 0 homebrew.mxcl.mysql@5.7
In my case I'm using mysql@5.7
You can stop using:
brew services stop mysql@5.7
回答9:
I've installed mysql via homebrew, but stop mysql by using mysql stop
command, mysql restart right now.
try to execute command as follow if your mysql was installed via homebrew
brew services stop $(brew list | grep mysql)
来源:https://stackoverflow.com/questions/29375253/unable-to-stop-mysql-on-os-x-10-10