Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres.app Could not start on port 5432

I'm using http://postgresapp.com. In the menubar it gives the error " Could not start on port 5432." Similarly if I try to start the server from the terminal, I get:

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.5432"? 

I also ran pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start and got the output server starting but still get the same errors when connecting to psql.

like image 769
Chris Avatar asked Aug 19 '12 16:08

Chris


People also ask

Is Postgres running on port 5432?

Usually Postgres is the only app interested in using port 5432, but if after issuing the first command to see what is running on port 5432, you find out that there is an application other than PostgreSQL running on port 5432, try to check the activity monitor and see what app might be interfering with your PostgreSQL ...

How do I enable port 5432?

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.

What application uses port 5432?

5432 (PostgreSQL) is used for Adaptive Authentication (TCP). Port 5432 is opened for the Postgres database used in the Behavioral Analytics feature of PCS. While scanning, customers may raise queries on 5432 Port as this port is enabled on the internal interface.


2 Answers

If you are running your server on a macOS machine and installed Postgres through Homebrew, you can stop the current instance like this:

brew services stop postgresql

Then click the Elephant in the native menu-bar at the top of the screen and it should successfully startup.

like image 125
Max von Hippel Avatar answered Sep 23 '22 13:09

Max von Hippel


You can stop the process by finding the PID with

lsof -i :5432 

and then killing it with

kill -9 <PID> 
like image 38
Некто Avatar answered Sep 25 '22 13:09

Некто