2016-11-17 5 views
1

閉じるメッセージのある投稿がたくさんあることは知っています。私はうまくすべてを読んだ。そして答えを見つけられませんでした。いくつかはlocalからhostまでのルールをhba.confにジャンプするために-h localhostを使用するように提案しています。何人かは、localtrustを設定すると言います...しかし、私はTCP以上ではなく、peer認証を求め、信頼できません!Postgres - ピア認証 - psql:致命的:ロール "xxxx"が存在しません

ので、私はOSDB両方のユーザーVAOがありますdocs

The peer authentication method works by obtaining the client's operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.

によると

$ psql t 
psql: FATAL: role "vao" does not exist 

t=# \! who am i 
vao  pts/8  2016-11-11 12:23 (10.1.10.158) 

t=# \du+ vao 
        List of roles 
Role name | Attributes | Member of | Description 
-----------+------------+-----------+------------- 
vao  | Superuser | {}  | 

、まだ私はpsqlへしようとすると、私はエラーを取得しますおよび

Peer authentication is only available on operating systems providing the getpeereid() function, the SO_PEERCRED socket parameter, or similar mechanisms. Currently that includes Linux, most flavors of BSD including OS X, and Solaris.

私はDebianがgetpeereid() またはSO_PEERCREDをサポートしているかどうかを調べるために、必死に説明します。

私がrealyzeになるまで、私は明らかに環境設定が不足していました。 psqlのは、ユーザーが見つからない場合は、多分それはsocketを見つけることができません。.. だから私はpostgresql.confunix_socket_directoriesをチェックし、 PSQLマニュアルに従って:

--host=hostname Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix-domain socket.

psql t -h '/path/to/unix_socket_directories'と出来上がりを試してみてください - 私はそこですよ?

これは私がこのレーキを踏む初めてのことではありません! 私はここに投稿します - 誰かを助けることを願っています。

答えて

1

このエラーは間違いです。

代わりの

psql: FATAL: role "xxx" does not exist

我々はEnvironment Variables

が不足しているので、export PGHOST=/var/run/postgresqlのようになめらかいること、考えに私たちを導くであろうと、

psql: FATAL: socket "yyy" does not exist

または何か他のものでなければなりません治すます儀式

関連する問題