psql: FATAL: role "vagrant" does not exist [duplicate] psql: FATAL: role "vagrant" does not exist [duplicate] postgresql postgresql

psql: FATAL: role "vagrant" does not exist [duplicate]


You don't have vagrant user in postgres, and when you run psql, it tries to login as vagrant user (the same name as OS user). You may try something like:

psql -U postgres -h localhost

to login as postgres user, with password specified in your Vagrantfile for postgresq user.

Then, you have several options:

  • Export PGUSER and PGHOST environment variables to set user and host (psql without parameters will use these values). You may also want to use .pgpass file to avoid entering password on each psql execute.

  • Modify Vagrantfile to create vagrant user in postgres with password