I'm following these instructions to Setting up a local dev environment for Craft CMS with Laravel Homestead. When I go to http://my-craft-site.dev/admin, I get:

Craft can’t connect to the database with the credentials in craft/config/db.php.

Not having much luck with Google/Stack searches on the error message. I can connect to the Homestead DB via Sequel Pro using the credentials in db.php so I’m a bit confused by the error message. DB Credentials:

u: homestead
p: secret
  • 1
    Let's see what your db.php file looks like. Check the name of the db in Homestead.Yaml as well Commented Oct 25, 2015 at 19:35
  • db.php and homestead.yaml contents: gist.github.com/komplexb/f1c7f461752e1d91834e
    – komplexb
    Commented Oct 25, 2015 at 20:28
  • Assuming devMode is on, you can check the console to see the values that Craft is getting from the config. That'll be your first clue. If Craft is getting the right values, and the db isn't responding, it'd be a host issue. If Craft is trying to log in with blank values, it's a config setup issue. Commented Oct 25, 2015 at 21:42

1 Answer 1


When in doubt, reinstall, or in this case do it over again from the top. That fixed it.

  • Even after destroying the box and reinstalling I still get the same error.
    – Bonk
    Commented Dec 29, 2016 at 16:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.