Last active
October 4, 2021 05:56
-
-
Save kamalpandey/ff7b6816067743a9995723bb04131083 to your computer and use it in GitHub Desktop.
Resolve PG::ConnectionBad: FATAL: password authentication failed for user "postgres"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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