psql: could not connect to server: Connection refused (0x0000274D/10061) in windows

Patan picture Patan · Dec 26, 2012 · Viewed 8.7k times · Source

I am trying to run psql.exe from command line. I am getting error as below.

C:\>cd C:\Program Files\PostgreSQL\8.3\bin

C:\Program Files\PostgreSQL\8.3\bin>psql.exe
psql: could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "???" and accepting
        TCP/IP connections on port 5432?

Can any one help how to resolve it.

Thanks in advance.

Answer

titanofold picture titanofold · Dec 26, 2012

You need to provide it some arguments:

C:\Program Files\PostgreSQL\8.3\bin> psql.exe -h localhost -U user -d database