ishwr
ishwr

Reputation: 745

rake db:create:all FATAL : password authentication failed

I am trying to follow this railscast tutorial. Now I am in the step, where you create the database with rake db:create:all, but I got this error message :

FATAL:  password authentication failed for user aldila

I made the user aldila through pgAdmin, by right-clicking the login role and add user aldila with password.

So, here is my database.yml :

development:
   adapter: postgresql
   host: localhost
   encoding: unicode
   database: my_app_development
   pool: 5
   username: aldila
   password: *mypass*

test:
   adapter: postgresql
   host: localhost
   encoding: unicode
   database: my_app_test
   pool: 5
   username: aldila
   password: *mypass*

production:
   adapter: postgresql
   host: localhost
   encoding: unicode
   database: my_app_production
   pool: 5
   username: aldila
   password: *mypass*

Here is my pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

Maybe there is something's wrong with the installing of PostreSQL, because if I type psql --version on my command, this is what I got :

'psql' is not recognized as an internal or external command,
operable program or batch file.

But I have no idea what went wrong. I install it from here and pick download the installer from EnterpriseDB for all supported versions.

I know there are already similar questions like this, but I follow this one and this one, but I still get the same error message. I would be really appreciated, if anyone could help. Thanks

Upvotes: 2

Views: 2272

Answers (1)

user2163649
user2163649

Reputation:

Your postgresSQL password didn't match your database.rb's password.. it depends on what environment you are using..

Upvotes: 2

Related Questions