Cannot start installation of Homebrew PostgreSQL on Mac OS X - "Permission denied"

I have Postgresql installed via Homebrew, and after the failure I can no longer start the server.

if i do

 $ pg_ctl start 

I get

pg_ctl: no database directory specified and environment variable PGDATA unset

If i do

$ pg_ctl -D /Library/PostgreSQL/data start

I get

pg_ctl: could not open PID file "/Library/PostgreSQL/data/postmaster.pid": Permission denied

Everything worked perfectly, and then ... out of nothing, this.

The data folder above has permissions set to "All" for the postgres user and "None" for everyone.

The path looks great (in my ~ / .bash_profile)

export PATH=/usr/local/bin:$PATH
+5
source share
1 answer

Pg, pg_ctl? , , , , Pg, homebrew / launchd, pg_ctl. homebrew ( Mac OS X ), , homebrew- Pg launchd ~/Library/LaunchAgents/org.postgresql.postgres.plist.

:

homebrew PostgreSQL? Pg pg_ctl, . , homebrew, , , postgres postgres_. :

ls -ld /Library/PostgreSQL/data

, , :

sudo -u postgres_ pg_ctl -D /Library/PostgreSQL/data start

... "postgres_" datadir.

, , , , . , ; Pg .

+6

All Articles