You have entered the correct host name, the user name that has full access and the complete database name in the config file??
Check in your cpanel if you have one to match that those are correct.

If you think they are correct then add them to this php script and upload it to your piblic_html folder using ftp or file manager and run it from the command line like this changing all the DB information including localhost if you need .. :
Code: 
http;//yoursite.com/testdb.php
Code: 
<?php
function ss_error($message) 
{
  echo  $message."<br>";
  die();
}

// set up database information 

$ss_dbhost = "localhost" ;
$ss_dbuser = "my_uusername";
$ss_dbpass = "my_databasepassword";
$ss_dbname = "my_databasename";

  if(!($ss_lnk = mysql_connect($ss_dbhost, $ss_dbuser, $ss_dbpass))) {
    ss_error("can not connect to MySql using $ss_dbhost using user $ss_dbuser");
    return;
  }
  if(!mysql_select_db($ss_dbname, $ss_lnk)) {
    ss_error("can not select database $ss_dbname");
    return;
  }
?>
save this in a file called testdb.php and upload to server..