Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection refused to PostgreSQL server

I am currently setting up a postreSQL server on my Windows computer.

I want to create my first database, but couldn't create the createdb function due to a password authetification failed. Thus I found the following question on this website:

How to configure postgresql for the first time?

However, I think I forgot the ; at the end of :

ALTER USER postgres with encrypted password 'xxxxxxx';

And now, when I try to launch psql, I have the following errors:

Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
Active code page: 1252
psql: could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
Press any key to continue . . .

Any idea of what I could do to solve the problem?

Do you think it is really the missing semi column that caused the problem?

Do you have any tutorial on how to setup a postgreSQL database on Windows? All the one I found until now were for Linux only.

like image 979
Aurel Avatar asked Jul 09 '14 12:07

Aurel


People also ask

Can't connect to server connection refused pgAdmin?

If pgAdmin displays this message, there are two possible reasons for this: the database server isn't running - simply start it. the server isn't configured to accept TCP/IP requests on the address shown.

How do I open port 5432?

Open Windows Firewall Port As an alternative you can go to Control Panel -> Systems and Security -> Windows Firewall -> Allow a program or feature through Windows Firewall -> Advanced Settings -> New Rule: Rule Type: Port. TCP or UDP: TCP. Specific local ports: 5432.


1 Answers

The error you're getting appears to be from Postgres not currently running, rather than an authentication error as you're presumed. The PSQL client or whatever PG client you're using is attempting to establish a connection on the default port but nothing is there.

If Postgres isn't currently running, try finding it (Via CTRL-Alt-Delete). If it's running, try terminating it and starting it up again. Hopefully that fixes the problem... Otherwise your port 5432 might be blocked for some reason.

If all fails, I am still skeptical the parentheses could cause this error because it's not an authentication error. Try to reinstall Postgres with a clean install.

like image 178
edenzik Avatar answered Sep 30 '22 08:09

edenzik