When trying to run mix ecto.create I got the following errors:
.Repo couldn't be created: tcp connect: connection refused - :econnrefused.Repo couldn't be created: FATAL (invalid_authorization_specification): role "postgres" does not exist.Repo couldn't be created: FATAL (invalid_authorization_specification): role "postgres" is not permitted to log inWhat are the conditions that Postgres must meet in order to properly setup Phoenix?
In order to run mix ecto.create you need a series of conditions:
Postgres must be up and running.
Postgres must have a user postgres with the password postgres.
The postgres user must have permissions to both LOGIN and CREATEDB.
I, for instance, had Postgres running locally but was missing the postgres user.
So within PSQL I had to use the following command:
# CREATE ROLE postgres LOGIN CREATEDB PASSWORD 'postgres';
And then it worked.
Kudos to Wendy Smoak.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With