How do I start MariaDB on boot on Mac OS X?

前端 未结 4 1037
广开言路
广开言路 2021-02-04 07:51

Just installed MariaDB (with homebrew). Everything looks like it\'s working, but I can\'t figure out how to have it automatically startup on boot on my Mac. I can\'t find any

相关标签:
4条回答
  • 2021-02-04 07:58

    You need to use launchd. See $ man launchd.

    Additionally, Nathan wrote a good article on launchd.

    0 讨论(0)
  • 2021-02-04 07:59

    If you install MariaDB by Homebrew, you can use this to see how to start your mariadb at login.

    brew info mariadb
    

    To have launchd start mariadb at login:

    ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
    

    Then to load mariadb now:

    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
    

    Or, if you don't want/need launchctl, you can just run:

    mysql.server start
    
    0 讨论(0)
  • From brew info mariadb

    To have launchd start mariadb now and restart at login:
      brew services start mariadb
    Or, if you don't want/need a background service you can just run:
      mysql.server start
    

    Just run brew services start mariadb on terminal.

    0 讨论(0)
  • 2021-02-04 08:19

    With help from Calvin's answer (deleted, I guess?), and this page, these are the steps I used to accomplish this:

    cp /usr/local/Cellar/mariadb/5.5.30/homebrew.mxcl.mariadb.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
    

    On next boot, MariaDB was up and running.

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