I am working on macOS High Sierra.

Basically, the problem is that for some reason the mysql server is starting and stopping automatically, and constantly. It does not stop. If I run:

# ps -ax | grep mysql

to see the processes even when I (think) I have uninstalled mysql, it shows:

54948 ttys002    0:00.00 grep mysql

I run the same thing 5 seconds later, and it has a different ID:

54950 ttys002    0:00.00 grep mysql

I cannot sudo kill -9 54950 because by the time I try to kill it, it has already disappeared.

I have tried removing everything related to mysql. I then reinstall it, and the same thing happens. I have tried doing this with homebrew as well.

Please help.

  • What is in mysql's log files?
    – Rick James
    Oct 22, 2019 at 4:21

2 Answers 2


You are not seeing any mysql processes.
You are seeing your own grep process, as it is looking for mysql processes.

To avoid this, try this:

ps -ef | grep mysql | grep -v $$ 

The "$$" in the second grep is expanded (by the shell) into the current command's pid, effectively filtering this out of the ps results (so you'd get an empty result).

... mysql server is starting and stopping automatically, and constantly.

Look in the mysql server log and see why it's "stopping" or, perhaps, not even starting.


Of course you will see your terminal running the grep command .. that's pretty much to be expected. Please learn some console basics (either mac os or free bsd related as that is the underlaying system that mac os builds on )

If ps -> grep really only shows its own instance then there is nothing else with "mysql" in its process name. Which pretty much explains that you cant kill the process afterwards - because the console-command did its work and then the process ended regularly. Hence your second attempt "generated" a new process ID (new process) ...

At the time of your ps -> grep NO "other" mysql process is running.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.