Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1617  / 2 Years ago, thu, may 19, 2022, 10:45:07

This is a new installation of Ubuntu 20.04 on OCI. Postgres database has been installed and is running fine. The problem is I am unable to connect to the database using the IP address of the host. Please see the error below.


psql -h 135.145.78.113 -p 5432 -d postgres -U postgres -W
Password:
psql: error: connection to server at "135.145.78.113", port 5432 failed: Connection timed out
Is the server running on that host and accepting TCP/IP connections?

When localhost is used, it connects as seen below.


psql -h localhost -p 5432 -d postgres -U postgres -W
Password:
psql (13.7 (Ubuntu 13.7-1.pgdg22.04+1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

Your support is much appreciated.


More From » networking

 Answers
2

I'm not sure whether this applies to you as I haven't got consistant info on the IP config, but it might do.


Judging by the picture following, the internal LAN address of your VM would not be the same as the IP you would use to connect remotely. If you are typing your commands on the VM you should use the internal IP address, or continue to use localhost.


OCI Setup Page


[#367] Thursday, May 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
;