PG :: ConnectionBad: FATAL: password authentication for user "alphauser"

I am working on an application in Rails for my college. The application was started by students from the previous year, and now my colleagues and I are asking for continued work on this. I took the application from github, I start the installation of the package, but when I started rake db:migrate, I got this PG::ConnectionBad: FATAL: password authentication failed for user "alphauser". In database.yml, I have these

 development:
  adapter: postgresql
  encoding: unicode
  database: alpha_database
  host: localhost
  pool: 5
  username: alphauser
  password: alphapassword

I do not know what to do in this case.

+6
source share
4 answers

You need to create the appropriate user and database manually as follows:

in the shell: psql

then

  create user alphauser with password 'alphapassword';
  create database alpha_database owner alphauser;
  alter user alphauser superuser createrole createdb replication;
  \q

don't forget the semicolons.

+11
source

:

sudo -u postgres createuser --interactive --pwprompt

+2

, rails database.yml, alphauser ( , / ).

, postgres , , alphauser alphapassword, , rake db:migrate on.

Postgres docs: http://www.postgresql.org/docs/9.2/static/app-createuser.html

createuser -P -s -e alphauser

alphauserpassword

+1
 create user alphauser with password 'alphapassword';

rake db:setup
0

All Articles