2

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 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

7 Comments

Hmm.. When I run that commend it is still requesting for a password. Please see my edited post.
Thanks for the update, I am still getting the same issue. It seems like when I use my normal sudo password it still doesn't work.
What do you get when you run: brew info postgres
I still haven't figured out the solution, I will mark it as the solution once it figure out. Thanks!
hello from 2017.. running into this exact issue :(
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.