error establishing a database connection


I have setup a multisite with as primary domain. The sub domain wildcard has also been successfully setup. But after I add a sub domain through network admin --> sites --> add new site and visit the sub domain I get an 'Error establishing a database connection'.

My .htaccess content is below;

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

I also tried to delete wp-config.php and .htaccess to reconfigure from scratch as suggested but that didn't work, I even tried a fresh install but still no luck.

I disabled all plugins but have an active Boss theme, also the install doesn't have www on it. I've provided you a support access so that you could look directly into the site. Let me know if you need further information.