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

CC BY-SA 3.0
2016-12-29T16:44:16.283Z
Even after destroying the box and reinstalling I still get the same error.
Bonk
CC BY-SA 3.0
2015-10-26T01:10:31.753Z
2015-10-26T01:10:31.753Z
komplexb
<p>I'm following <a href="https://medium.com/@mattcollins_6/setting-up-a-local-dev-environment-for-craft-cms-using-laravel-homestead-2724be3954a5#.bsm07bevu" rel="nofollow">these instructions</a> to Setting up a local dev environment for Craft CMS with Laravel Homestead.
When I go to <code>http://my-craft-site.dev/admin</code>, I get:</p>

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

<p>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: </p>

<pre><code>u: homestead
p: secret
</code></pre>

CC BY-SA 3.0
2015-10-25T19:35:50.240Z
Let's see what your `db.php` file looks like.  Check the name of the db in `Homestead.Yaml` as well
andrew.welch
CC BY-SA 3.0
2015-10-25T20:28:20.433Z
db.php and homestead.yaml contents: https://gist.github.com/komplexb/f1c7f461752e1d91834e
komplexb
CC BY-SA 3.0
2015-10-25T21:42:57.717Z
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.
Michael Rog
<database><config>
Laravel Homestead & Craft: Craft can’t connect to the database with the credentials in craft/config/db.php
# Laravel Homestead & Craft: Craft can’t connect to the database with the credentials in craft/config/db.php

(Asked by: username_0 on 2015-10-25)

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

**Tags:** database, config
> **Comments:**
> **username_1**: Let's see what your `db.php` file looks like.  Check the name of the db in `Homestead.Yaml` as well  
> **username_0**: db.php and homestead.yaml contents: https://gist.github.com/komplexb/f1c7f461752e1d91834e  
> **username_2**: 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.  

---

## 1 answers

### Answer by username_0 on 2015-10-26. Score: 2 | Accepted answer

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

> **Comments:**
> **username_3**: Even after destroying the box and reinstalling I still get the same error.  

---

