Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to mix ecto.create, role 'postgres' does not exist [duplicate]

I tried creating a user called postgres. I reinstalled postgres through brew. I'm able to run it with

postgres -D /usr/local/var/postgres

when I run mix ecto.create, I still get the error:

~/code/blog_phoenix:.mix ecto.create
** (Mix) The database for BlogPhoenix.Repo couldn't be created, reason given: psql: FATAL:  role "postgres" does not exist.
~/code/blog_phoenix:.
like image 749
quantumpotato Avatar asked Feb 07 '16 19:02

quantumpotato


1 Answers

It looks like your database installation is missing the role postgres.

You should try to connect using the default credentials and then execute the SQL statement to create the role and its default database.

In a console run:

$ psql

then

CREATE USER postgres SUPERUSER;
CREATE DATABASE postgres WITH OWNER postgres;
like image 187
josemrb Avatar answered Oct 17 '22 18:10

josemrb