su postgresはMac OSでは動作しません

su postgresはMac OSでは動作しません

努力しています:

su postgres

ルートパスワードを入力しましたが受信しました:申し訳ありません。以下を試しました。

sudo -u postgres

ただし、受信:現在のディレクトリが認識されません:権限が拒否されました。

私が試したとき

 sudo su postgres

受け取る:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

pg_hba.confから

local   all             all                                     trust

ベストアンサー1

  • su postgres

postgres代わりにユーザーのパスワードが必要ですroot

  • sudo -u postgres

Permission denied

解決策が見つかりましたhttps://trac.macports.org/ticket/18024

cd /tmp ; sudo -u postgres...

したがって、ユーザーはpostgresコマンドを実行するCWDに対する権限を持っていませんsudo

  • pg_hba.conf

su関連/非関連sudo、psql、またはデータベースクライアントのデータベース接続に使用されます。

おすすめ記事