Skip to content

Instantly share code, notes, and snippets.

@kamalpandey
Last active October 4, 2021 05:56
Show Gist options
  • Select an option

  • Save kamalpandey/ff7b6816067743a9995723bb04131083 to your computer and use it in GitHub Desktop.

Select an option

Save kamalpandey/ff7b6816067743a9995723bb04131083 to your computer and use it in GitHub Desktop.
Resolve PG::ConnectionBad: FATAL: password authentication failed for user "postgres"
#go to pg_hba.conf
Add a new line to the top of pg_hba.conf:
local all postgres peer
#go to psql
sudo -u postgres psql
#enter the following command to set or change the password
ALTER USER postgres PASSWORD 'postgres_password';
#go to pg_hba.conf and remove the line previously added i.e remove
local all postgres peer
#try to rake db:create or migrate again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment