在Mac上安装PostgreSQL的方法是什么?
目标
Spina やsolidusioを使ってみたいときにPostgreSQLが必要なので!
限制
-
- macOS High Sierra(ver 10.13.5)
- Homebrew
项目
-
- Homebrewを使用してPostgreSQLをインストール
-
- PostgreSQLの起動 / 起動確認 / 停止方法
- データベース一覧を表示
使用Homebrew安装PostgreSQL。
brew install postgresql
psql -V
# psql (PostgreSQL) 10.4
which psql
# /usr/local/bin/psql
PostgreSQL的启动/启动确认/停止方法
brew services start postgresql
# ==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
brew services list
# postgresql started uesrname /Users/uesrname/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
brew services stop postgresql
# ==> Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql)
展示数据库列表
psql -l
Name | Owner | Encoding | Collate | Ctype | Access privileges
----------------+--------------+----------+-------------+-------------+-------------------------------
ec_development | Owner_name | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
ec_test | Owner_name | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | Owner_name | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | Owner_name | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/name
| | | | | name=CTc/name
template1 | Owner_name | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/shimadayuhki
| | | | | name=CTc/name
尝试使用PostgreSQL
[电子商务网站]尝试一下使用Rails制作的Solidus(v2.3.0)
[管理面板]尝试仅触碰Spina