jSutcliffe90
jSutcliffe90

Reputation: 323

PostgreSQL has two servers running on port 5432, Mac 10.11

I know that this is a common issue with a lot of resources online but nothing seems to have worked for myself so far. When I try to start the pg server (I downloaded the postgres.app) I always get the same there is already a PostgreSQL server running on port 5432. I used the command sudo lsof -i 5432 and got this as a result:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

postgres 69175 badman 5u IPv6 0xfb574d5e65486297 0t0 TCP localhost:postgresql (LISTEN)

postgres 69175 badman 6u IPv4 0xfb574d5e68f8fbc7 0t0 TCP localhost:postgresql (LISTEN)

I have tried installing pg multiple times using homebrew, postgres.app and accidentally installed pg Enterprise when I first got my mac. I don't know if multiple downloads of pg from different sources maybe affecting it, despite me trying to uninstall them. How can I fix this so that I'm only using one, preferably the postgres.app installation (as i'm new to coding and it's what I'm used to). Im using Mac v10.11.6

Upvotes: 1

Views: 3463

Answers (1)

Dinesh Potluru
Dinesh Potluru

Reputation: 4921

Find the Process with Port:

$ lsof -i :5432

Kill the process with Process ID:

$ kill -9 <PID>

In your case kill -9 69175

**Note: Sometimes lsof -i :port will show nothing. try sudo lsof -i :port

Upvotes: 1

Related Questions