MySQL does not start when upgrading OSX to Yosemite or El Capitan

后端 未结 18 2133
南方客
南方客 2020-12-04 09:59

I know similar questions exist, such as MySQL with MAMP does not work with OSX Yosemite 10.10. However, I do have MAMP, nor XAMPP installed on my computer.

When I tr

18条回答
  •  执笔经年
    2020-12-04 10:31

    Long story short you need to create a launch file. So, from Terminal:

    sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist

    (If you are not familiar with vi, then press i to start inserting text)

    This should be the content of your file:

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

    press esc then : wq!enter

    Then you need to give the file the right permissions and set it to load on startup.

    sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist 
    sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist 
    sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
    

    And that is it.

提交回复
热议问题