Craft on digital ocean Ubuntu: Craft can’t connect to the database with the credentials in craft/config/db.php
Could you post your nginx/apache configuration?

In short the configuration array key is matched based on the server name (server_name in nginx, ServerName in Apache httpd iirc).

If you're using some sort of default configuration it might not have a server_name, or a bogus one.

Thus, if your configuration array is like this:

&lt;?php

return array(

  '1.2.3.4' =&gt; array(
    'someSetting' =&gt; 'foo'
  );
);


You should have a corresponding configuration in (nginx in this example):

server {
  listen 80;
  server_name 1.2.3.4;
  ....
}


If you have more than one host in server_name, Craft will match on the first.