Craft can't connect to db.php on live server My Craft files are structured correctly, I have the Craft file level with the public_html file on the server (which contains the index.php file), within index.php I have set my $craftpath correctly to $craftPath = '../craft';.

But when I go to my live url I get a Craft styled error of: 

Service Unavailable
Our site is temporarily unavailable. Please try again later.


When I try to reach my admin I get an error of:

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


If it helps, my general.php file looks like this: 

return array(
    '*' =&gt; array(
        'omitScriptNameInUrls' =&gt; true
    ),

    // development
    'example.dev' =&gt; array(
        'environmentVariables' =&gt; array(
            'devMode' =&gt; true,
            'siteUrl'  =&gt; 'http://example.dev/',
            'assetPath' =&gt; 'http://example.dev/assets/'
        )
    ),

    // production
    'example.com' =&gt; array(
        'environmentVariables' =&gt; array(
            'devMode' =&gt; false,
            'siteUrl'  =&gt; 'http://example.com/',
            'assetPath' =&gt; 'http://example.com/assets/'
        )
    )
);


And the db.php file is as such:

return array(
    '*' =&gt; array (
        'tablePrefix' =&gt; 'craft',
    ),
    'example.dev' =&gt; array (
        'server' =&gt; 'localhost',
        'user' =&gt; 'root',
        'password' =&gt; 'root',
        'database' =&gt; 'localdatabase',
    ),
    'example.com' =&gt; array (
        'cooldownDuration' =&gt; 0,
        'server' =&gt; 'server',
        'user' =&gt; 'user',
        'password' =&gt; 'password',
        'database' =&gt; 'database',
    )
);


I hope you can help becuase I'm lossing my mind as to whats wrong, but I'm sure it's something minor that I'm overlooking.
The cooldownDuration setting should go in your general.php config file, not in your db.php config file. On your server, is the db on a separate server or is it on the same server? If so, the value for server in example.com should be localhost not server.