<p>I've been trying to get a quick staging environment setup on GoDaddy all day.</p>

<p>By using <code>die('foo')</code> I can tell that GoDaddy is able to reach all of my files (<code>public/index.php</code>, <code>craft/config/db.php</code> and <code>general.php</code>). I have created two different databases and users to try to connect to. I am also using the hostname's generated by GoDaddy.</p>

<p>However, even with the correct db information and knowing for a fact that Craft is able to find my <code>db.php</code> file, when I browser to <code>mydomain.com/index.php?p=admin/install</code> I'm still receiving the following error:</p>

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

<p><strong>db.php</strong></p>

<p>

<pre><code>/**
 * Database Configuration
 *
 * All of your system's database configuration settings go in here.
 * You can see a list of the default settings in craft/app/etc/config/defaults/db.php
 */

// die('foo');

return array(

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

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

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

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

CC BY-SA 3.0
2016-10-28T19:36:07.847Z
Omit the `user` and `password`, and post the rest of your `db.php` into your question.
Lindsey D
CC BY-SA 3.0
2016-10-28T19:49:27.880Z
Are `dbhost` and `dbname` the actual values, or just placeholders? Obviously those won't work. :)
Lindsey D
CC BY-SA 3.0
2016-10-28T19:51:07.623Z
Haha, yes, placeholders. The database "server" supposedly does not work as `localhost` on Godaddy. See Mark's answer here: http://craftcms.stackexchange.com/a/10543/5471
Steven Thate
CC BY-SA 3.0
2016-10-28T19:52:08.713Z
Lol, yeah... GoDaddy is weird about that. That would have been my guess though.
Lindsey D
CC BY-SA 3.0
2016-10-28T20:56:51.607Z
Can you connect using those credentials through a MySQL client?
Brad Bell
CC BY-SA 3.0
2016-10-28T20:58:43.810Z
Yes, sorry I should have mentioned that. I am able to connect via phpMyAdmin with the same credentials I am using in db.php
Steven Thate
CC BY-SA 3.0
2016-11-02T13:27:41.510Z
I'm still not certain why GoDaddy can't connect to the database for Craft, but I started a trial at Cloudways. I was able to get everything up and running with them. It has to be a user (ie, me!) error at GoDaddy somewhere... but oh well. It's a good excuse to use something other than GoDaddy! :)
Steven Thate
<database>
How to get GoDaddy to connect to db?
# How to get GoDaddy to connect to db?

(Asked by: username_0 on 2016-10-28)

I've been trying to get a quick staging environment setup on GoDaddy all day.
By using die('foo') I can tell that GoDaddy is able to reach all of my files (public/index.php, craft/config/db.php and general.php). I have created two different databases and users to try to connect to. I am also using the hostname's generated by GoDaddy.
However, even with the correct db information and knowing for a fact that Craft is able to find my db.php file, when I browser to mydomain.com/index.php?p=admin/install I'm still receiving the following error:

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

db.php

/**
 * Database Configuration
 *
 * All of your system's database configuration settings go in here.
 * You can see a list of the default settings in craft/app/etc/config/defaults/db.php
 */

// die('foo');

return array(

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

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

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

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

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

);

**Tags:** database

> **Comments:**
> **username_1**: Omit the `user` and `password`, and post the rest of your `db.php` into your question.  
> **username_1**: Are `dbhost` and `dbname` the actual values, or just placeholders? Obviously those won't work. :)  
> **username_0**: Haha, yes, placeholders. The database "server" supposedly does not work as `localhost` on Godaddy. See Mark's answer here: http://craftcms.stackexchange.com/a/10543/5471  
> **username_1**: Lol, yeah... GoDaddy is weird about that. That would have been my guess though.  
> **username_2**: Can you connect using those credentials through a MySQL client?  
> **username_0**: Yes, sorry I should have mentioned that. I am able to connect via phpMyAdmin with the same credentials I am using in db.php  
> **username_0**: I'm still not certain why GoDaddy can't connect to the database for Craft, but I started a trial at Cloudways. I was able to get everything up and running with them. It has to be a user (ie, me!) error at GoDaddy somewhere... but oh well. It's a good excuse to use something other than GoDaddy! :)  

---

## 0 answers

