PostgresSQL, or simply Postgres, is a relational database. It's the de facto standard for SQL databases, and is the preferred SQL database of Mashup Garage.
Phoenix projects default to connecting to Postgres with the username
postgres and password
postgres. This isn't so easy to override, so let's just keep that as the default.
The easiest way to install PostgreSQL is through Homebrew.
In macOS, use Homebrew to install it.
# OSX only brew install postgres
Use homebrew/services to start Postgres. Optional but recommended.
# OSX only brew tap homebrew/services brew services start postgres
createuser to create a new user. Give it a password
$ createuser --superuser postgres -P Enter password for new role: Enter it again:
The preferred way to get PostgreSQL working on Linux is through Docker.
See this guide for details.
Create a file called
docker-compose.yml in the root of your project:
version: '3' services: db: image: postgres ports: - '5432:5432' volumes: - 'pgdata:/var/lib/postgresql/data' environment: POSTGRES_PASSWORD: postgres volumes: pgdata:
Run it using docker-compose: