failed: could not connect to server: Permission denied

General support questions
Post Reply
xo)mora
Posts: 58
Joined: 2017/01/13 20:52:59

failed: could not connect to server: Permission denied

Post by xo)mora » 2018/12/12 18:35:35

Hi, please Will you help me please? I didn't find the error.

I had been migrate a perl web application in centos 7 but I had couldn't run a perl script with data base pgsql conection the error was:

DBI connect('dbname=users;host=localhost','owner',...) failed: could not connect to server: Permission denied
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Permission denied
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432? at /var/www/cgi-bin/../script.cgi line 39.

[*]I checked if the port 5432 was runnig:

-rw-------. 1 postgres postgres 47 Dec 12 10:28 .s.PGSQL.5432.lock
srwxrwxrwx. 1 postgres postgres 0 Dec 12 10:28 .s.PGSQL.5432

[*]I checked if the port 5432 [root@epot ~]# firewall-cmd --get-active-zones
public
interfaces: eno16777984

[*]I did the all points markes in: http://desarrollowebtutorial.com/conexi ... -centos-7/

I'm hopeless, please will you help me?

Thanks a lot.
Regards.

xo)mora
Posts: 58
Joined: 2017/01/13 20:52:59

Re: failed: could not connect to server: Permission denied

Post by xo)mora » 2018/12/12 20:09:41

I checked the database privileges and I found:

postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
root | Cannot login | {}
other | Superuser | {root}

Is it correct?

Probably is very easy but I didn't find the solution.

Regards.

Post Reply