Home:ALL Converter>psql: could not connect to server: No such file or directory on Windows

psql: could not connect to server: No such file or directory on Windows

Ask Time:2017-04-15T21:30:42         Author:Arnold

Json Formatter

When I try to connect to my postgresql database with psql I receive the error message:

D:\>psql -U postgres
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5112"?

A similar error I get when using createdb:

createdb: could not connect to database template1: could not connect to server: No such file or directory

next two lines are identical to the psql error.

I can start pgadminIII without problems and access my databases. when I check the properties of the connection it uses port 5432. When using process explorer I see about 5 postgresql processes, though none accessing port 5432. The solutions I found in this forum are about linux/osx platforms, which I am not able to translate into a windows solution.

Could anybody tell what is wrong/what I am doing wrong and suggest a solution?

Thanks for your time.

Author:Arnold,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/43426648/psql-could-not-connect-to-server-no-such-file-or-directory-on-windows
yy