DEV Community

PostgreSQL - port 5432 already in use

balt1794 on February 11, 2021

For more content, visit: baltlogs When installing your Postgres database for the first time, one of the problems that might arise is that two d...
Collapse
 
henleyridgemc profile image
Henley Ridge MC Ltd #MSInspire

Thanks for this info - nearly 5pm on a Friday for me, what better time to solve a problem :) I can go into the weekend with one less thing to fix.

Collapse
 
balt1794 profile image
balt1794

I'm glad I could help

Collapse
 
lucasdabra profile image
Lucas Silva

Thanks!!!

Collapse
 
mikedroid profile image
Miguel Ángel Reyes Moreno

Thanks for the post, it was what I needed!

Collapse
 
balt1794 profile image
balt1794

Awesome! Glad it helped

Collapse
 
jeisson_caicedo_840e6889f profile image
Jeisson Caicedo

Thank u so much!!!!!!!!

Collapse
 
balt1794 profile image
balt1794

Thanks for leaving a message. I'm glad the tutorial was helpful :)

Collapse
 
imran_khan_d46c1ebbd38324 profile image
Imran Khan

I followed these commands and get the following prompt: pkill: Unknown user `postgres'

Image description

Collapse
 
awaken180dev profile image
Jeremy Lopez

I know this is late but hopefully it helps someone. -u needs to be followed by the name in the USER column. In your case it would be -u lilimiindahouse. CAUTION this will crash your computer and you will need to restart it. I did that and following the restart everything worked properly. In my situation killing by the PID did not work as the process restarted itself with a different PID immediately. Killing the USER was the only solution.

Collapse
 
imran_khan_d46c1ebbd38324 profile image
Imran Khan

and still not able to run Postgres can someone plz help!? Thanks

Collapse
 
imran_khan_d46c1ebbd38324 profile image
Imran Khan

sudo kill -kill $(sudo lsof -t -i :5432)

use this command^^^^^^^^^

Collapse
 
imran_khan_d46c1ebbd38324 profile image
Imran Khan

sudo kill -kill $(sudo lsof -t -i :5432)

This command saved my life!! ^^^^^