This was initially specifically in relation to errors when setting up Phoenix/Mix in relation to Postgres.
role "postgres" does not exist": https://hexdocs.pm/phoenix/phoenix_mix_tasks.html#ecto-specific-mix-tasks- Try logging in by running
psqlmanually first. - If that doesn't work, try:
- From the command line:
psql -d template1: this logs you into a default database. - Now EXIT
psqlby doing\q;from their shell; we just logged in to make sure it was possible at all. - From the command line:
createdb. This creates the default database for the user you are currently logged in as. - Try
psqlagain -- you should login fine. - From inside
psql, do:create role postgres login createdb;This creates a user/role under the name ofpostgres, to whom we give the ability both to login and to create databases. \q;to exit
- From the command line:
- Try logging in by running