実現したいこと
Window10でWSL上でpostgresqlを使用する時にpsqlが使用できない。
・sudo service postgresql startでpostgresql起動
・psql -U postgresを実行
⇒psql: error: FATAL: Peer authentication failed for user "postgres"エラー
発生している問題・エラーメッセージ
psql: error: FATAL: Peer authentication failed for user "postgres"
試したこと
https://qiita.com/Jackson123/items/266ca4a6165881f53ae7
peer認証をON→OFFに変更するためpg_hba.confの設定を変える
postgresqlの設定ファイルを探す
find / -print |grep pg_hba.conf
⇒/etc/postgresql/12/main/pg_hba.conf
sudo vi /etc/postgresql/12/main/pg_hba.confで
⇒
<修正前>
//"local" is for Unix domain socket connections only
local all all peer
を下記の内容に変更
<修正後>
// "local" is for Unix domain socket connections only
local all all trust
エラーは同じでした。

回答1件
あなたの回答
tips
プレビュー