2

getting an error while connecting remotely and the error says something like

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host x and accepting TCP/IP connections on port 5432?

please help me out

3
  • please take a look to the output of this command: netstat -lp on the server where postgresql should be running. Commented Mar 7, 2013 at 12:30
  • 3
    Connection timed out always almost means that a firewall blocks the connection. Commented Mar 7, 2013 at 12:39
  • 1
    Can you connect on the server (local)? Try logging as postgres user on a shell and execute psql: su - postgres -c psql. And check the value of listen_address on postgresql.conf, should be * or the IP. Commented Mar 7, 2013 at 14:56

1 Answer 1

2

Open your terminal and write

service postgresql status

If it says it is not running than write

service postgresql start

If the service is already running then check the listening port of your postgresql service via

netstat -an | grep postgresql

and the result will show the port it is listening.And then you can connect your database with the command

psql -h localhost -p port_you_found -U postgres
Sign up to request clarification or add additional context in comments.

1 Comment

netstat -an | grep postgresql returned nothing. Now what?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.