Today,
I was trying to configure POSTGRESQL server in Fedora Linux OS system. On my surprise, when I typed:
# psql -d railsapp_development -U rails_db_user -W
It gave me the following error:
# psql: FATAL: Ident authentication failed for user "username"
For, solving this issue, you will have to edit the following file:
vim /var/lib/pgsql/data/pg_hba.conf
This file has various functionalites apart from controlling how the user/clients are authenticated. By default, POSTGRESQL, supporst IDENT based authentication. IDENT based authentication will not allow you to login with -U and -W option.
The following changes has to be done inside pg_hba.conf file:
# Type Database User CIDR-ADDRESS METHOD
----------------------------------------------------------------------------------------------------
local all all trust
host all all 127.0.0.1/32 trust
Basically you will have to replace ident with trust.
Now restart the server with the following command:
# /etc/init.d/postgresql restart
After this you will be able to login.
Note, that I was facing the above mentioned error, when I was trying to invoke the command rake db:migrate in rails.
But after doing the above mentioned changes, migrations started working fine.
But after doing the above mentioned changes, migrations started working fine.
Just the tip I needed for getting my existing Rails Heroku project working locally on a Fedora machine. Thanks!
ReplyDeleteI am glad to hear that :)
ReplyDeleteConfronting Postgres Authentication Problem? Contact to PostgreSQL Relational Database Service
ReplyDeleteAt whatever point any client doing their first PostgreSQL login then in the meantime they get a blunder message like: "Secret key validation fizzled for clients Postgres". In any case, unwind! Since here we manage this issue by giving you a powerful and propelled support. Truly, this issue requires some specialized learning however with Cognegic's Postgres SQL Support for Windows or Postgres SQL Support for Linux you can without much of a stretch handle this issue and fathom instantly.
For More Info: https://cognegicsystems.com/
Contact Number: 1-800-450-8670
Email Address- info@cognegicsystems.com
Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801