Reputation: 31
I Just made a new app in phoenix. Im following along with the Programming Phoenix book. I am on chapter 3 and after making the files and using:
mix phoenix.server
I get an angry red error saying:
[error] Postgrex.Protocol (#PID<0.234.0>) failed to connect: **
(Postgrex.Error) FATAL 28000 (invalid_authorization_specification):
role "postgres" does not exist
it keeps repeating this over and over.
Upvotes: 0
Views: 836
Reputation: 581
Edit: Changes made to reflect comments.
This will delete all local databases
rm -rf /usr/local/var/postgres && initdb /usr/local/var/postgres -E utf8
sudo -u <your local username> psql postgres
CREATE USER postgres SUPERUSER;
CREATE DATABASE postgres WITH OWNER postgres;
This simply creates the Postgres user
psql -U postgres
CREATE USER postgres;
Thanks @Dogbert, @mudasobwa
Upvotes: 4