LoginSignup
29
28

More than 5 years have passed since last update.

PostgreSQLのerror FATAL: Ident authentication failed for user

Last updated at Posted at 2014-08-17

rake コマンドを実行したら、PostgreSQLでエラーがでました。CentOS環境です。

rakeコマンドでエラー
bundle exec rake db:create
FATAL:  Ident authentication failed for user "hoge_user"

pg_hba.confを修正する必要があるみたいです。

pg_hba.confを書き換え
sudo vi /var/lib/pgsql/data/pg_hba.conf

# "local" is for Unix domain socket connections only
local   all         all                               ident sameuser
# 上記をtrustに変更
local   all         all                               trust

ident sameuserと書いてある箇所をtrustに書き換えるとエラーが出ないようです。
PostgreSQLを再起動します。

PostgreSQLを再起動
sudo /etc/init.d/postgresql restart

rakeコマンドを実行したらエラーが出ませんでした。

29
28
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
28