Autostart MySQL Server on Mac OS X Yosemite/El Capitan

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

    None of the other provided answers worked to auto-start my MySQL server. I followed the instructions from the MySQL 5.6 handbook and it finally auto-starts again! Create the file /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist with the following content:

    
    
    
    
        Label             com.oracle.oss.mysql.mysqld
        ProcessType       Interactive
        Disabled          
        RunAtLoad         
        KeepAlive         
        SessionCreate     
        LaunchOnlyOnce    
        UserName          _mysql
        GroupName         _mysql
        ExitTimeOut       600
        Program           /usr/local/mysql/bin/mysqld
        ProgramArguments
            
                /usr/local/mysql/bin/mysqld
                --user=_mysql
                --basedir=/usr/local/mysql
                --datadir=/usr/local/mysql/data
                --plugin-dir=/usr/local/mysql/lib/plugin
                --log-error=/usr/local/mysql/data/mysqld.local.err
                --pid-file=/usr/local/mysql/data/mysqld.local.pid
                --port=3306
            
        WorkingDirectory  /usr/local/mysql
    
    
    

    And run the following commands after creating the file:

    cd /Library/LaunchDaemons
    sudo launchctl load -F com.oracle.oss.mysql.mysqld.plist
    

提交回复
热议问题