Support the ongoing development of Laravel.io →
Configuration Database

I've set up a brand new L5 installation, and am trying to get it to talk to my existing tables. When I do a php artisan migrate I get the error message...

[PDOException]                             
SQLSTATE[HY000] [2002] Connection refused

and I've got no idea how to go about debugging issues like this. Any hints on how to delve into this problem?

Last updated 3 years ago.
0

It looks like a database configuration mismatch. Given "Connection refused", I'm betting it doesn't load ip/port/credentials correctly from the configuration.

I haven't been looking at L5 since it was released, but when I last played with it, they moved database configuration to .env files. so it would be a good place to start. If you haven't already, check out the 4.2 to 5.0 upgrade doc for hints to this.

0

I had copied/edited the .env file, and placed all the same credentials as my L4 app which still works ok, so I'm still pretty stuck on this... :-(

[update] Just tried this on another new installed L5, running with MAMP, and if I have "localhost" in the .env file I get a No such file or directory message, whereas if i have 127.0.0.1 instead I get Connection refused.

Last updated 10 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.