K
K
Kastuś2021-12-16 06:57:16
linux
Kastuś, 2021-12-16 06:57:16

What is the problem with connecting to postgresql?

Good afternoon
Please tell me I compiled
a program to connect to postgresql with one request, and I run it on a clean virtual machine and I get an error from root
QSqlError("", "QPSQL: Unable to connect", "fe_sendauth: no password supplied\n") I run it

on my computer when debugging, everything is fine (I connect to a virtual machine),
on a clean (without qt) laptop under a user (sudo) it’s normal (I connect to a virtual machine), but if I create a new user, then the error is higher, and I issued the same groups and the error did not go away.
Changed chown to root for the whole folder. The folder on the laptop is the same on the virtual machine
. What could be the problem?

Pghba
postgree settings. conf
host all all 0.0.0.0/0 md5
Postgresql. Conf
... Allowed='*'

If I change md5 to trust, the connection appears for everyone

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
galaxy, 2021-12-16
@Gytim

Neither the code nor the settings, of course, need to be shown. Well, really, why?..
Judging by

no password supplied

in the Qt code, the connection goes without a password.
To make the connection without a password work, you need to configure pg_hba.conf

K
Kastuś, 2021-12-18
@Gytim

My jamb in
host all all 0.0.0.0/0 md5

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question