[MAC] 讓 MariaDB 跟著開機自動啟動

MariaDB 是 MySQL 的另一個開源分支,逐漸取代 MySQL 成為主流資料庫系統。

1. 查詢安裝的 MariaDB 的版本與位置:
$ brew info mariadb
出現類似以下訊息,可以看到路徑是 /usr/local/Cellar/mariadb/10.1.14

mariadb: stable 10.1.14 (bottled)
Drop-in replacement for MySQL
https://mariadb.org/
Conflicts with: mariadb-connector-c, mysql, mysql-cluster, mysql-connector-c, mytop, percona-server
/usr/local/Cellar/mariadb/10.1.14 (573 files, 131.1M) *
Poured from bottle on 2016-06-08 at 12:35:07

2. 找到 homebrew.mxcl.mariadb.plist
在 ~/Library/LaunchAgents/ 建立連結
$ ln -sfv /usr/local/Cellar/mariadb/10.1.14/homebrew.mxcl.mariadb.plist ~/Library/LaunchAgents/

3. 啟動 MariaDB 下次開機就會自動啟動拉
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

發表迴響