3

これは私を困惑させています(MacOS Lionでpostgresをセットアップしようとしています):

delirium:$ sudo ls -al /usr/local/pgsql/data/
total 64
drwx------  15 postgres  postgres    510 25 May 10:36 .
drwxr-xr-x@ 13 103       103         442 25 May 10:35 ..
-rw-------   1 postgres  postgres      4 25 May 10:36 PG_VERSION
drwx------   5 postgres  postgres    170 25 May 10:36 base
drwx------  41 postgres  postgres   1394 25 May 10:36 global
drwx------   3 postgres  postgres    102 25 May 10:36 pg_clog
-rw-------   1 postgres  postgres   3652 25 May 10:36 pg_hba.conf
-rw-------   1 postgres  postgres   1631 25 May 10:36 pg_ident.conf
drwx------   4 postgres  postgres    136 25 May 10:36 pg_multixact
drwx------   2 postgres  postgres     68 25 May 10:36 pg_stat_tmp
drwx------   3 postgres  postgres    102 25 May 10:36 pg_subtrans
drwx------   2 postgres  postgres     68 25 May 10:36 pg_tblspc
drwx------   2 postgres  postgres     68 25 May 10:36 pg_twophase
drwx------   4 postgres  postgres    136 25 May 10:36 pg_xlog
-rwxr-xr-x   1 postgres  postgres  16879 25 May 10:36 postgresql.conf
delirium:$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
postgres cannot access the server configuration file "/usr/local/pgsql/data/postgresql.conf": Permission denied

出力は postgres が の所有者であることを示していませんpostgresql.confか? では、なぜファイルにアクセスできないのでしょうか?

私に何ができる?

4

2 に答える 2

3

アクセス許可拒否エラーを診断する最も簡単な方法は、そのユーザーとしてログイン (suまたは) し、ファイルにアクセスすることです。sudocat

これが許可が拒否され、ファイルが見つからない場合、postgres ユーザーは親ディレクトリの 1 つに対する実行許可を持っていないと推測されます。それは 3 つのいずれかである可能性があります。/usr/local/pgsql/

于 2012-05-25T11:06:43.827 に答える
0
sudo -u postgres /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data

...postgresがデフォルトのユーザーで設定されていると仮定しますpostgres

于 2017-05-23T23:56:33.490 に答える