postgresql - Postgres access with www-data and --host argument -


i want access postgres www-data user. command launched cli.

my program need able launch command :

psql --username www-data --host=127.0.0.1 --dbname=dbname 

it work if remove --host=127.0.0.1, unfortunately use third party program command , can change it.

my pg_hba.conf standard local postgres peer

# type  database        user            address                 method  # "local" unix domain socket connections local                                                   peer #host               www-data         127.0.0.1/32            md5 # ipv4 local connections: host                            127.0.0.1/32            md5 # ipv6 local connections: host                            ::1/128                 md5 

in postgresql.conf put

listen_addresses = '*' 

yes it's insecure testing everything. still doesn't work

in .pgpass

127.0.0.1:5432:*:www-data:password 

i tried method : peer, ident, md5, password, had error everytime.

the error message (in french) :

fatal:  authentification par mot de passe ?chou?e pour l'utilisateur  << www-data >> mot de passe récupéré dans le fichier fichier « /var/www/.pgpass » 

it means authentication password failed user www-data. reports able recover password pgpass (/var/www/.pgpass).

thanks help, have no idea do.

ok extremely stupid.

when made createuser command, used -w instead of -p. misread createuser --help :(

i realized mistake when tried recreate www-data time, , saw password asked 1 time instead of 2 times.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -