How do you stop MySQL on a Mac OS install?

前端 未结 20 1429
暗喜
暗喜 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:24

    Apparently you want:

    sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
    

    Have a further read in Jeez People, Stop Fretting Over Installing RMagic.

    0 讨论(0)
  • 2020-11-30 16:24

    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.

    0 讨论(0)
  • 2020-11-30 16:24

    This worked for me on macOS 10.13.6 with 8.0.12 MySQL

    /usr/local/mysql/support-files/mysql.server start

    /usr/local/mysql/support-files/mysql.server restart

    /usr/local/mysql/support-files/mysql.server stop

    0 讨论(0)
  • 2020-11-30 16:25

    On OSX Snow Leopard

    launchctl unload /System/Library/LaunchDaemons/org.mysql.mysqld.plist
    
    0 讨论(0)
  • 2020-11-30 16:26

    mysql> show variables where variable_name like '%dir%';

    | datadir | /opt/local/var/db/mysql5/ |

    0 讨论(0)
  • 2020-11-30 16:27

    sudo /usr/local/mysql/support-files/mysql.server stop

    0 讨论(0)
提交回复
热议问题