/ / Macでpostgresqlを実行できない(再起動後) - linux、macos、postgresql、パーミッション、postgresql-9.2

Macでpostgresqlを実行できない(リブート後) - linux、macos、postgresql、permissions、postgresql-9.2

何をしても、再起動後にMac 10.9.3上でpostgresql 9.2を再起動できませんでした。

$ initdb -D /usr/local/var/postgres
The files belonging to this database system will be owned by user "alex".
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.

initdb: directory "/usr/local/var/postgres" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/usr/local/var/postgres" or run initdb
with an argument other than "/usr/local/var/postgres"

その中に別のディレクトリを作成することにしました。そこで、そこにデータディレクトリを作成し、initdbを再度実行しました。

$ initdb -D /usr/local/var/postgres/data
The files belonging to this database system will be owned by user "alex".
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/data ... initdb:
could not change permissions of directory "/usr/local/var/postgres/data":
Operation not permitted

アクセス許可を変更しようとしましたが、正しいアクセス許可が何であるかがわかりません。

$ ls -ald /usr/local/var/postgres
drwxr-xr-x  22 _postgres  staff  748 Jun 13 17:26 /usr/local/var/postgres

ls -ald /usr/local/var/postgres/data
drwxr-xr-x  2 _postgres  staff  68 Jun 13 17:26 /usr/local/var/postgres/data


$ ls -al /usr/local/var/postgres
total 96
drwxr-xr-x  22 _postgres  staff        748 Jun 13 17:26 .
drwx------   3 alex       admin        102 Jun  1 15:08 ..
-rw-------   1 _postgres  _postgres      4 Jun  1 15:08 PG_VERSION
drwx------   6 _postgres  _postgres    204 Jun  2 11:40 base
drwxr-xr-x   2 _postgres  staff         68 Jun 13 17:26 data
drwx------  42 _postgres  _postgres   1428 Jun  2 14:18 global
drwx------   3 _postgres  _postgres    102 Jun  1 15:08 pg_clog
-rw-------   1 _postgres  _postgres   4465 Jun  2 10:58 pg_hba.conf
-rw-------   1 _postgres  _postgres   1636 Jun  1 15:08 pg_ident.conf
drwx------   4 _postgres  _postgres    136 Jun  1 15:08 pg_multixact
drwx------   3 _postgres  _postgres    102 Jun  1 18:24 pg_notify
drwx------   2 _postgres  _postgres     68 Jun  1 15:08 pg_serial
drwx------   2 _postgres  _postgres     68 Jun  1 15:08 pg_snapshots
drwx------   7 _postgres  _postgres    238 Jun  2 21:23 pg_stat
drwx------   2 _postgres  _postgres     68 Jun  2 21:23 pg_stat_tmp
drwx------   3 _postgres  _postgres    102 Jun  1 15:08 pg_subtrans
drwx------   2 _postgres  _postgres     68 Jun  1 15:08 pg_tblspc
drwx------   2 _postgres  _postgres     68 Jun  1 15:08 pg_twophase
drwx------   4 _postgres  _postgres    136 Jun  1 15:08 pg_xlog
-rw-------   1 _postgres  _postgres  20571 Jun  1 15:08 postgresql.conf
-rw-------   1 _postgres  _postgres     79 Jun  1 18:24 postmaster.opts
-rw-------   1 _postgres  _postgres   1482 Jun  2 21:23 server.log

次に何をしますか?私は考えから抜け出しています。唯一の推測は、それがファイルまたはフォルダーの許可に関連しているということです。

回答:

回答№1は0

二段階のプロセス:

  1. あなたのウェブブラウザに行き、 "postgresql permissions data directory"を探してください - 公式マニュアルからページのリストを見てください(それが私にとって一番のものです)。
  2. 読む 公式マニュアルのページ そして指示に従ってください。

おそらくそれは「それができなかったことを訴える」アクセス許可を変更してください。これは、ユーザー "_postgres"としてこれを実行していないためです。注 - これは「通常はユーザーの」postgresです。名前の変更が自分の行ったものなのか、Macインストールでよくあることなのかわかりません。

ああ - そして、私はなぜこれが "linux"とタグ付けされているかわかりません。