2016-01-14 8 views
9

にinitdbのは/ usr/localの/ var/postgresの私はエルキャピタンに自作経由のPostgreSQL 9.5をインストールした後initdb /usr/local/var/postgresを実行しようとしていますが、私は以下の取得:エルキャピタン

The files belonging to this database system will be owned by user "kyledecot". 
This user must also own the server process. 

The database cluster will be initialized with locale "en_US.UTF-8". 
The default database encoding has accordingly been set to "UTF8". 
The default text search configuration will be set to "english". 

Data page checksums are disabled. 

fixing permissions on existing directory /usr/local/var/postgres ... initdb: could not change permissions of directory "/usr/local/var/postgres": Operation not permitted 

cd /usr/local/var/postgresしようとしたときに、私が取得:

cd: permission denied: /usr/local/var/postgres 

私はこれを行うための適切な権限を持っていないようです。私はこれがエル・キャピタンのSystem Integrity Protectionで何かすることを前提としていますが、間違っている可能性があります。

これを修正するにはどうすればよいですか?

答えて

21

sudo chown -R `whoami` /usr/local

9

私はこの質問/エラーに関連するスタックオーバーフローに関する質問を見てきたアドバイスの2ビットを組み合わせなければなりませんでした。私はポストグルを再インストールし、パーミッションを一度に1つずつ変更する鶏と卵の状況で自分自身を見つけましたが、どちらのコマンドもお互いに矛盾していました。

sudo chown -R `whoami` /usr/local && brew postinstall postgresql 

...、それがうまく働いた:

だから私はこれをしませんでした。

+0

"post install"ではなく "postinstall"を使用する必要があります –

2

私はそれが本当に効率的ではありません見つけるとchownにすべて/usr/localディレクトリを確保するので、私は単に mkdir /usr/local/var/postgres

を行なったし、すべてがスムーズに行ってきました。

+0

私はPostbusでHomebrewを古いバージョンでインストールしていましたが、これをアンインストールして、 'find/-name postgres'で見つけたすべてのpostgresqlファイルを削除してから' mkdir/usr/local/var/postgres'は私に嬉しいインストールをしました。 – lshepstone

関連する問題