Kycklingar / PBooru

The Unlicense
46 stars 1 forks source link

password authenication failed for user pbdb #60

Closed anoduck closed 4 years ago

anoduck commented 4 years ago

I have a fresh posgres db. Created a new user with create user pbdb and created database with create database pbdb. Then I granted all rights on db to user with grant all on database pbdb to user pbdb. Then I added the following line to pg_hba.conf:

#TYPE    Database    USER    ADDRESS    METHOD
local    pbdb        pbdb                peer

But I still recieve the following error:

anic: pq: password authentication failed for user "pbdb"

goroutine 1 [running]:
github.com/kycklingar/PBooru/DataManager.Setup(0xc0001c8b40, 0x1d)
    /go/src/github.com/kycklingar/PBooru/DataManager/datamanager.go:47 +0x27d
main.main()
    /go/src/github.com/kycklingar/PBooru/main.go:82 +0x50

What did I forget to configure? Or what have I done wrong?

Also I wanted to fully dockerize the installation. So, what is the full string for DBCfg, so I can modify the password and listening address if needed?

Kycklingar commented 4 years ago

Using the peer auth-method you'll need to provide the password for that systems account. Under the DBCfg->ConnectionString add 'password=yourpassword'. Alternatively change the auth-method to trust (or md5, etc) in your pg_hba.conf

https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING https://www.postgresql.org/docs/current/auth-pg-hba-conf.html

anoduck commented 4 years ago

Viola! It has been a while since I set up a postgres db from scratch. Thanks for enlightening me. Great work on the booru btw! really impressive.