LoginSignup
52
50

More than 5 years have passed since last update.

[DB]MacにPostgreSQLをインストールする方法

Last updated at Posted at 2018-07-08

目的

  • Spinasolidusioを使ってみたいときにPostgreSQLが必要なので!

条件

  • macOS High Sierra(ver 10.13.5)
  • Homebrew

項目

  • Homebrewを使用してPostgreSQLをインストール
  • PostgreSQLの起動 / 起動確認 / 停止方法
  • データベース一覧を表示

Homebrewを使用してPostgreSQLをインストール

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を使ってみる

[ECサイト]Rails製Solidus(v2.3.0)を触りだけやってみた

[管理画面]Spinaを触りだけやってみた

52
50
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
52
50