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
andPGHOST
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 eachpsql
execute.Modify Vagrantfile to create
vagrant
user in postgres with password