Autostart MySQL Server on Mac OS X Yosemite/El Capitan

前端 未结 7 1366
抹茶落季
抹茶落季 2020-12-02 05:10

I would like to auto start the MySQL server on startup. This was possible in Mavericks but seems to be not working on Yosemite.

edit: seems this wo

7条回答
  •  悲&欢浪女
    2020-12-02 05:27

    When I used the plist suggested in earlier answers, I changed the user to _mysql for my system, but the "Stop MySQL Server" button in the MySQL preference pane no longer worked. The KeepAlive key will cause the process to launch again immediately after the Stop button is pressed. I used the key RunAtLoad to get it to just start on reboot, but allow the button in the pane to continue working.

    
    
    
      
        RunAtLoad
        
        Label
        com.mysql.mysqld
        ProgramArguments
        
        /usr/local/mysql/bin/mysqld_safe
        --user=_mysql
        
      
    
    

    Then, as in the other answers, ran:

    sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
    

    Now, MySQL launches on restart, but the MySQL pane in System Preferences still works. I'm running El Capitan, 10.11.2

提交回复
热议问题