How do you stop MySQL on a Mac OS install?

前端 未结 20 1478
暗喜
暗喜 2020-11-30 16:08

I installed MySQL via MacPorts. What is the command I need to stop the server (I need to test how my application behave when MySQL is dead)?

20条回答
  •  生来不讨喜
    2020-11-30 16:41

    After try all those command line, and it is not work.I have to do following stuff:

    mv /usr/local/Cellar/mysql/5.7.16/bin/mysqld /usr/local/Cellar/mysql/5.7.16/bin/mysqld.bak
    mysql.server stop
    

    This way works, the mysqld process is gone. but the /var/log/system.log have a lot of rubbish:

    Jul  9 14:10:54 xxx com.apple.xpc.launchd[1] (homebrew.mxcl.mysql[78049]): Service exited with abnormal code: 1
    Jul  9 14:10:54 xxx com.apple.xpc.launchd[1] (homebrew.mxcl.mysql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
    

提交回复
热议问题