<p>Sorted, thanks. The keen-eyed of you will notice that there was a space character in the server connection details. Idiot</p>

CC BY-SA 3.0
2014-12-01T12:41:43.580Z
I'd also suggest you remove the real DB name in future too... :)
Sean Delaney
CC BY-SA 3.0
2014-11-28T16:12:24.403Z
2014-11-28T16:12:24.403Z
Cole Henley
<p>I'm trying to set up Craft and on deployment to a staging server am getting the following error message:</p>

<blockquote>
  <p>An exception has been thrown during the rendering of a template
  ("Craft can't connect to the database with the credentials in
  craft/config/db.php.") in "_layout" at line 39.</p>
</blockquote>

<p>The config file in question is posted up at <a href="https://gist.github.com/cole007/f32c7ba984a3d35b1d24" rel="nofollow">https://gist.github.com/cole007/f32c7ba984a3d35b1d24</a></p>

<p>Any thoughts?</p>

<p>Cheers in advance,</p>

<p>Cole</p>

CC BY-SA 3.0
2014-11-28T16:02:54.887Z
As far as I can see your config looks absolutely fine... could it simply be a DB credential issue for that particular environment?
Steve Abraham
<config><database><multi-environment><environments>
Multi-environment config issue
# Multi-environment config issue

(Asked by: username_0 on 2014-11-28)

I'm trying to set up Craft and on deployment to a staging server am getting the following error message:

> An exception has been thrown during the rendering of a template
> ("Craft can't connect to the database with the credentials in
> craft/config/db.php.") in "\_layout" at line 39.

The config file in question is posted up at <https://gist.github.com/cole007/f32c7ba984a3d35b1d24>

Any thoughts?

Cheers in advance,

Cole

**Tags:** config, database, multi-environment, environments

> **Comments:**
> **username_1**: As far as I can see your config looks absolutely fine... could it simply be a DB credential issue for that particular environment?  

---

## 1 answers

### Answer by username_0 on 2014-11-28. Score: 1

Sorted, thanks. The keen-eyed of you will notice that there was a space character in the server connection details. Idiot

> **Comments:**
> **username_2**: I'd also suggest you remove the real DB name in future too... :)  

---

