Autostart MySQL Server on Mac OS X Yosemite/El Capitan

前端 未结 7 1367
抹茶落季
抹茶落季 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:32

    @dcc was very close. This is how MySQL autostarts again on Yosemite:

    The com.mysql.mysql.plist in /Library/LaunchDaemons:

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

    Additionally I've changed the permissions based on this answer

    sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist
    sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
    

    Finally I run this command

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

    If you have any addition please share below!

提交回复
热议问题