Has been rather a while since I last blogged. And this update is rather technical so if you’re not into databases or Elixir programming, look away.
If you get the rather strange error message below after running the
mix ecto.create command:
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
** (Mix) The database for AppName.Repo couldn't be created: killed
Run this command if you have previously set up the Postgres app for MacOS before installing Postgres using Homebrew.
/usr/local/opt/postgresql/bin/createuser -s postgres
The problem should be resolved!
The issue arises because the Postgres app creates a database superuser with your login name rather than the traditional role name of ‘
postgres‘. Mix’s ecto.create command can’t work as a consequence.