Skip to content

Latest commit

 

History

History
31 lines (29 loc) · 1.92 KB

step_six_database.md

File metadata and controls

31 lines (29 loc) · 1.92 KB

Databases : Step Six

  1. Type brew tap homebrew/services to install brew services. Thoughtbot has a great guide on this tool.
  2. Run brew install postgres to install PostgreSQL.
  3. Start PostgreSQL via brew services start postgres and create your base db via the following command:
createdb `whoami`
  1. If everything worked correctly you can verify this by attaching to Postgres by typing psql. Please note this installation of Postgres via Homebrew was adapted from install-postgresql-on-mac-os-x-via-brew and this stackoverflow post. Unfortunately my local copy of Postgres was borked so I rebuilt it at one point by going "nuclear" and removing everything.
rm -rf /usr/local/var/postgres && initdb /usr/local/var/postgres -E utf8
  1. Run brew install redis to install Redis.
  2. Start Redis via brew services start redis
  3. Start Redis via brew services start postgresql
  4. Verify we are running the latest versions of our core database technlogies.
psql --version
psql -c "SELECT version();"
pg_dump --version
  1. If everything has been setup correctly, here is an example output of those commands.
psql (PostgreSQL) 14.1
                                                     version
------------------------------------------------------------------------------------------------------------------
 PostgreSQL 14.1 on x86_64-apple-darwin21.1.0, compiled by Apple clang version 13.0.0 (clang-1300.0.29.3), 64-bit
(1 row)

pg_dump (PostgreSQL) 14.1