13

I am running mysqld on Mac OSX Al Capitan. After boot up, I ran mysql.server start to start mysqld server.

But when I ran mysql.server stop, or sudo mysql.server stop, it just stopped for a while, later it will automatically restart itself again.

I also tried mysqladmin -uroot -p -hlocalhost shutdown for no avail.

It just keeps restarting again and again.

I guess it's maybe related to mysql_safe process, but I don't know how to properly stop mysqld, and force it not to restart again, until I myself run mysql.server start manually. Thanks!

Michael Green
  • 25,255
  • 13
  • 54
  • 100
Zhang Buzz
  • 245
  • 1
  • 2
  • 10

3 Answers3

14

If you used homebrew to install mysql, mysqld will keep on restarting unless you use following brew command:

brew services list

brew services list output

Get the name of service to stop and then run the following command:

brew services stop mysql@5.5

From: https://stackoverflow.com/a/57169447/2670370

6

In my case, it kept on restarting as soon as I killed the process using PID. Also brew stop command didn't work as I installed without using homebrew. Then I went to mac system preferences and we have MySQL installed there. Just open it and stop the MySQL server and you're done. Here in the screenshot, you can find MySQL in bottom of system preferences.enter image description here

1

After install mysql by running brew install mysql, I ran the recommended command: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist, thus it put something in the above directory.

I later installed a tool called 'lunchy' for simplify the launchctl work, after I ran lunchy stop mysql, it never come up again.

I also tried to run launchctl stop homebrew.mxcl.mysql, it did kill mysql process, but after a while it was started again.

Maybe lunchy did some trick here? I don't know.

Zhang Buzz
  • 245
  • 1
  • 2
  • 10