Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't make postgresql load at startup in Mac OS

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?

like image 368
Minh Ha Pham Avatar asked Oct 13 '14 06:10

Minh Ha Pham


People also ask

How do I start PostgreSQL on Mac terminal?

`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!

Why my PostgreSQL is not working?

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.


2 Answers

Use -w option with launchctl.

$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist  

-w Overrides the Disabled key and sets it to false.

like image 175
Parag Bafna Avatar answered Oct 20 '22 02:10

Parag Bafna


The new way as brew info postgresql says:

brew services start postgresql 
like image 22
KARASZI István Avatar answered Oct 20 '22 02:10

KARASZI István