2
votes

When ever I am trying to run psql in the command line, it is asking for a Password: .

I'm not too sure what the username and password is.

I installed postgresql by brew install postgres

pg_hba.conf

# the database superuser.  If you do not trust all your local users,
# use another authentication method.


# TYPE  DATABASE        USER            ADDRESS                 METHOD

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

Let me know if there is any confusion in my question.

Edit

enter image description here

In other posts, it mentions if I change pg_hba.conf file to local all all trust, I shouldn't require a password. But it is still requesting for a password.

When I run brew info postgres enter image description here

I've followed the steps from Postgresql: password authentication failed for user "postgres", but i'm still having the same issue. I added the line

local all postgres ident

1

1 Answers

2
votes

If you want to create a new database account from you own OS account use:

/usr/local/bin/createdb someusername

See if this works. Also this other SO Question might help.

Edit:

Use brew info postgres for more information about your version.