1

I am working on a project where I need to connect Laravel to a postgres db. First time doing this, in the past just used mysql. I am getting this error PDOException::("SQLSTATE[08006] [7] FATAL: no pg_hba.conf entry for host when I try to run php artisan migrate. I am on a mac so I used brew install postgresql. This is a db that already has tables in it.

In my .env file I changed my db to

DB_CONNECTION=pgsql
DB_HOST=<host name>
DB_PORT=5432
DB_DATABASE=<db name>
DB_USERNAME=<user name>
DB_PASSWORD=<password>

What else am I missing?

1 Answer 1

2

It seems like your config is missing in pg_hba.conf file.

Suppose you are on localhost, have you tried adding host all all 0.0.0.0/0 md5 entry in your pg_hba.conf? Remember to restart your postgresql services after that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.