<p>So a couple of things:</p>

<ul>
<li>It's probably not a great idea to connect as <code>root</code> -- it'd be better to create a mysql user that has access only to that db.</li>
<li>Make sure that the db you're connecting to is indeed named <code>Craft</code> (case may count here, I'm not sure)</li>
<li>The <code>table_prefix</code> looks wrong to me; probably it should be just: <code>'tablePrefix' =&gt; 'craft',</code></li>
</ul>

<p>You also might consider checking out <a href="https://nystudio107.com/blog/multi-environment-config-for-craft-cms" rel="noreferrer">Multi-Environment Config for Craft CMS</a> for multi-environment configs for Craft.</p>

CC BY-SA 3.0
2017-01-23T20:00:46.440Z
Good point about not using "root". On a local dev box it's not a big deal but as soon as you hit the cloud, all bets are off. Someone should let Solspace know about that flub... AWS users really should know better.
RitterKnight
CC BY-SA 3.0
2017-01-23T20:32:58.780Z
Thanks for the feedback guys. Ive already had the table prefix at 'tablePrefix' => 'craft', and it was apparently wrong running it through phpchecker so i read to try changing 'craft', to "'craft'", and it cleared the syntax error..
Tom
CC BY-SA 3.0
2017-01-23T20:44:38.960Z
When i change the table_prefix it connects but gives me the white screen of death??!
Tom
CC BY-SA 3.0
2017-01-24T17:13:46.947Z
have you tried navigation to the install url? (/admin)
Jan_dh
CC BY-SA 3.0
2017-01-24T18:30:18.657Z
Yep, trying to navigate to any page just has a white blank page
Tom
CC BY-SA 3.0
2017-01-24T18:41:23.753Z
I think maybe i should add that my db is an AWS RDS mysql instance? If that changes anything? Ive tried rebooting the instance and nothing
Tom
CC BY-SA 3.0
2017-01-24T20:01:42.347Z
They are 27 big steps! My bet is on permissions, Tom. Did you test your domain name with a (any) dummy file?
Nutmeg
CC BY-SA 3.0
2017-01-25T13:28:33.520Z
Do you mean trying url with any file i.e. /index.php? Because yeah, I've tired that. It just says "service unavailable"
Tom
CC BY-SA 3.0
2017-01-23T18:45:33.103Z
2017-01-23T18:45:33.103Z
andrew.welch
<p>I imagine you must have noticed this as your text editor would have highlighted them, but if not check your quote marks. Even if wrapping them in both quotations is intentional, you still have one that is ‘ and one that is '. They look similar but are not the same. run your code through this to clean special characters.
<a href="http://www.nousphere.net/cleanspecial.php" rel="nofollow noreferrer">http://www.nousphere.net/cleanspecial.php</a></p>

CC BY-SA 3.0
2017-09-20T16:46:12.100Z
2017-09-20T16:46:12.100Z
ToddPadwick
<p>If your db is on an aws rds instance you have to update the host parameter. </p>

<p>You can find it in the aws management console, it will be something like: </p>

<pre><code>&lt;rdsname&gt;.&lt;random stuff&gt;.&lt;region&gt;.rds.amazonaws.com
</code></pre>

<p>All in all after looking at the post I would say it is fairly outdated and I wouldn't recommend it.</p>

<p>Read this article: <a href="https://nystudio107.com/blog/web-hosting-for-agencies-freelancers" rel="nofollow noreferrer">https://nystudio107.com/blog/web-hosting-for-agencies-freelancers</a> and if you're not a server guy, consider outsourcing it to forge or similar.</p>

CC BY-SA 3.0
2017-09-21T10:55:42.997Z
2017-09-21T10:55:42.997Z
Erik Weber
<p>I'm trying to set up a Craft based site with ec2 and it won't connect with the info in db.php.</p>

<p>I've reinstalled the Craft files and also run all .phps through <a href="http://phpcodechecker.com" rel="nofollow noreferrer">http://phpcodechecker.com</a> to check for errors and nothing. Logs all check out to be in working order. And I've followed every step exactly with this tutorial: <a href="https://solspace.com/blog/spinning-up-a-craft-cms-development-site-on-amazon-ec2" rel="nofollow noreferrer">https://solspace.com/blog/spinning-up-a-craft-cms-development-site-on-amazon-ec2</a></p>

<p>Here's what my db.php file looks like:</p>

<pre><code>return array(

    // The database server name or IP address. Usually this is 'localhost' or '127.0.0.1'.
    'server' =&gt; 'localhost',

    // The name of the database to select.
    'database' =&gt; 'Craft',

    // The database username to connect with.
    'user' =&gt; 'root',

    // The database password to connect with.
    'password' =&gt; '*******',

    // The prefix to use when naming tables. This can be no more than 5 characters.
    'tablePrefix' =&gt; "‘craft'",
);
</code></pre>

<p>I also checked .htaccess files.</p>

<database>
Craft can't connect to the database (using ec2)
# Craft can't connect to the database (using ec2)

(Asked by: username_0 on 2017-01-23)

I'm trying to set up a Craft based site with ec2 and it won't connect with the info in db.php.
I've reinstalled the Craft files and also run all .phps through http://phpcodechecker.com to check for errors and nothing. Logs all check out to be in working order. And I've followed every step exactly with this tutorial: https://solspace.com/blog/spinning-up-a-craft-cms-development-site-on-amazon-ec2
Here's what my db.php file looks like:
return array(

    // The database server name or IP address. Usually this is 'localhost' or '127.0.0.1'.
    'server' => 'localhost',

    // The name of the database to select.
    'database' => 'Craft',

    // The database username to connect with.
    'user' => 'root',

    // The database password to connect with.
    'password' => '*******',

    // The prefix to use when naming tables. This can be no more than 5 characters.
    'tablePrefix' => "‘craft'",
);

I also checked .htaccess files.

**Tags:** database


---

## 3 answers

### Answer by username_1 on 2017-01-23. Score: 5

So a couple of things:

* It's probably not a great idea to connect as `root` -- it'd be better to create a mysql user that has access only to that db.
* Make sure that the db you're connecting to is indeed named `Craft` (case may count here, I'm not sure)
* The `table_prefix` looks wrong to me; probably it should be just: `'tablePrefix' => 'craft',`

You also might consider checking out [Multi-Environment Config for Craft CMS](https://nystudio107.com/blog/multi-environment-config-for-craft-cms) for multi-environment configs for Craft.

> **Comments:**
> **username_2**: Good point about not using "root". On a local dev box it's not a big deal but as soon as you hit the cloud, all bets are off. Someone should let Solspace know about that flub... AWS users really should know better.  
> **username_0**: Thanks for the feedback guys. Ive already had the table prefix at 'tablePrefix' => 'craft', and it was apparently wrong running it through phpchecker so i read to try changing 'craft', to "'craft'", and it cleared the syntax error..  
> **username_0**: When i change the table_prefix it connects but gives me the white screen of death??!  
> **username_3**: have you tried navigation to the install url? (/admin)  
> **username_0**: Yep, trying to navigate to any page just has a white blank page  
> **username_0**: I think maybe i should add that my db is an AWS RDS mysql instance? If that changes anything? Ive tried rebooting the instance and nothing  
> **username_4**: They are 27 big steps! My bet is on permissions, username_0. Did you test your domain name with a (any) dummy file?  
> **username_0**: Do you mean trying url with any file i.e. /index.php? Because yeah, I've tired that. It just says "service unavailable"  

---

### Answer by username_5 on 2017-09-20. Score: 1

I imagine you must have noticed this as your text editor would have highlighted them, but if not check your quote marks. Even if wrapping them in both quotations is intentional, you still have one that is ‘ and one that is '. They look similar but are not the same. run your code through this to clean special characters.
<http://www.nousphere.net/cleanspecial.php>


---

### Answer by username_6 on 2017-09-21. Score: 1

If your db is on an aws rds instance you have to update the host parameter. 
You can find it in the aws management console, it will be something like: 
...rds.amazonaws.com

All in all after looking at the post I would say it is fairly outdated and I wouldn't recommend it.
Read this article: https://nystudio107.com/blog/web-hosting-for-agencies-freelancers and if you're not a server guy, consider outsourcing it to forge or similar.


---

