Tuesday 17 July 2018

PostgreSQL psql.bin: could not connect to server: Connection refused

-bash-4.2$ psql
psql.bin: could not connect to server: Connection refused
     Is the server running locally and accepting
     connections on Unix domain socket "/tmp/.s.PGSQL.5444"?
-bash-4.2$

Not able to connect to psql,,pg server is down
Start server using pg_ctl
-bash-4.2$ pg_ctl start -U postgres -D /u01/app/edb/data
waiting for server to start....2018-07-17 14:09:50 IST FATAL:  data directory "/u01/app/edb/data" has group or world access
2018-07-17 14:09:50 IST DETAIL:  Permissions should be u=rwx (0700).
 stopped waiting
pg_ctl: could not start server
Examine the log output.
-bash-4.2$ pg_ctl start -U postgres -D /u01/app/edb/data
waiting for server to start....2018-07-17 14:10:34 IST LOG:  listening on IPv4 address "0.0.0.0", port 5444
2018-07-17 14:10:34 IST LOG:  listening on IPv6 address "::", port 5444
2018-07-17 14:10:34 IST LOG:  listening on Unix socket "/tmp/.s.PGSQL.5444"
2018-07-17 14:10:34 IST LOG:  redirecting log output to logging collector process
2018-07-17 14:10:34 IST HINT:  Future log output will appear in directory "log".
 done
server started

-bash-4.2$ psql
Password:
psql.bin (10.1.5)
Type "help" for help.
enterprisedb=# \l
                                      List of databases
     Name     |    Owner     | Encoding |   Collate   |    Ctype    | ICU |       Access privileges      
--------------+--------------+----------+-------------+-------------+-----+-------------------------------
 edb          | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |     |
 enterprisedb | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |     |
 postgres     | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |     |
 template0    | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |     | =c/enterprisedb              +
              |              |          |             |             |     | enterprisedb=CTc/enterprisedb
 template1    | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |     | =c/enterprisedb              +
              |              |          |             |             |     | enterprisedb=CTc/enterprisedb
 testdb       | enterprisedb | UTF8     | en_US.UTF-8 | en_US.UTF-8 |     |
(6 rows)

No comments:

Post a Comment