Created
May 19, 2020 09:20
-
-
Save Innarticles/ff65feb18d19f3dc17f9bf6ef2f06832 to your computer and use it in GitHub Desktop.
To fix it remove/rename the PID file. Find the postgres data directory. On macOS using homebrew it is in /usr/local/var/postgres/, or /usr/local/var/log/ other systems it might be /usr/var/postgres/. To make sure this is the problem, look at the log file (server.log).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To fix it remove/rename the PID file. Find the postgres data directory. On macOS using homebrew it is in /usr/local/var/postgres/, or /usr/local/var/log/ other systems it might be /usr/var/postgres/. | |
To make sure this is the problem, look at the log file (server.log). On the last lines you will see: | |
``` | |
FATAL: lock file "postmaster.pid" already exists | |
HINT: Is another postmaster (PID 347) running in data directory "/usr/local/var/postgres"? | |
``` | |
If so, `rm postmaster.pid` | |
Restart your server. On a mac using launchctl (with homebrew) the following commands will restart the server. | |
```brew services restart postgresql``` | |
From https://stackoverflow.com/questions/19828385/pgconnectionbad-could-not-connect-to-server-connection-refused |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment