'port 5432 is already in use postgres mac

When installing Postgresql 11 I got an error. I did the lesson right. Searched Google but didn’t find. I'm not trying to run different versions of postgresql, I'm just trying to install it.

Error message: Port 5432 is already in use



Solution 1:[1]

$ sudo lsof -i :5432
$ sudo pkill -u postgres

This is what fixed it for me, the lsof -i :5432 didn't show me anything, but after running the second command, I could finally use port 5432.

Solution 2:[2]

The error is already evident in the screenshot. Postgres by default runs on post 5432 unless you configure it otherwise.

Go to your terminal and type in pg_ctl stop to stop postgres and try again.

You can also type ps aux|grep postgres and see what processes are currently using postgres.

Solution 3:[3]

The OS X creates a user name PostgreSQL by default and that creates this issue. You will need to delete this user as you will never need to log in as the user and you should get the port 5432 free to use.

Solution 4:[4]

Usually this means that there is already a PostgreSQL server running on your Mac.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kai - Kazuya Ito
Solution 2 Mohamed Anees A
Solution 3 Arefe
Solution 4 joshpme