I have installed postgresql
via HomeBrew
. It worked but today I find that postgresql
server does not run when computer start.
I try to use launchctl
to load it again with below command:
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
and I see the message:
/usr/local/Cellar/postgresql/9.3.4/homebrew.mxcl.postgresql.plist: Service is disabled
I do not know how to enable postgresql service. Could anyone show me?
`psql` on Terminal To get to the PostgreSQL terminal, open your terminal, start the database services ( brew services start postgresql) , then run psql . Thank you!
To be sure that PostgreSQL is running, you can also restart it with systemctl restart postgresql. If this does not fix the problem, the most likely cause of this error is that PostgreSQL is not configured to allow TCP/IP connections. To correct this, edit your posgresql. conf file.
Use -w
option with launchctl
.
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
-w
Overrides the Disabled key and sets it to false.
The new way as brew info postgresql
says:
brew services start postgresql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With