How to connect to PostgreSQL database with Laravel Homestead?

Viewed 5356

I have updated the DB connection in my .env file to change the default mysql database to use PostgreSQL DB. But I don't know how to proceed with this.

DB_CONNECTION=pgsql

For example, we use

mysql -uhomestead -psecret <DB Name>

to connect to our database. By using psql, how to connect to DB?

2 Answers

To connect to postgress via ssh using psql i do:

psql -U homestead -h 127.0.0.1 -p 5432 myappdb

# this will ask for a password
# the default in homestead is secret
Related