Antarr Byrd
Antarr Byrd

Reputation: 26071

Unable to setup rails database

I'm trying to setup my rails environment for development on CentOS7. When I try to create the database I get the error

PG::ConnectionBad: FATAL: no pg_hba.conf entry for host "[local]", user "antarr", database "postgres", SSL off. Below are my configurations

/var/lib/pgsql/10/data/pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             postgres                                trust
# IPv4 local connections:
host    all            all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            ident
host    replication     all             ::1/128                 ident

hostnossl all           all             0.0.0.0/0               trust
host    all             all             0.0.0.0/0               md5

postgresql.conf

listen_addresses = '*'

Upvotes: 0

Views: 40

Answers (1)

Vishal
Vishal

Reputation: 818

You can see that in the local type you have privileges for the user postgres change it to all so that antarr user can connect to your DB or in your database.yml set username as postgres

for more info see HERE

Upvotes: 1

Related Questions