如何在Mac OS X上启动MariaDB?

时间:2013-07-04 02:56:01

标签: macos mariadb

刚刚安装了MariaDB(带有自制软件)。一切看起来都在起作用,但我无法弄清楚如何让它在我的Mac上启动时自动启动。我找不到任何特定于Mac的文档。

安装输出显示:

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

我想我不知道正确的地方在哪里。

4 个答案:

答案 0 :(得分:12)

来自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

只需在终端上运行brew services start mariadb

答案 1 :(得分:10)

在Calvin的回答(删除,我猜?)和this page的帮助下,这些是我用来完成此任务的步骤:

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

在下次启动时,MariaDB启动并运行。

答案 2 :(得分:8)

如果您通过Homebrew安装MariaDB,您可以使用它来查看如何在登录时启动您的mariadb。

<ion-header-bar class="bar bar-header bar-dark">
        <h1 class="title">Heading</h1>
      </ion-header-bar>

要在登录时启动启动mariadb:

brew info mariadb

然后立即加载mariadb:

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

或者,如果您不想/需要launchctl,您可以运行:

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

答案 3 :(得分:2)

您需要使用launchd。请参阅$ man launchd

此外,launchd上的Nathan wrote a good article