I am having a multisite network hosted on cloud. I came across the error "Error establishing a database connection" both in front and back end for the 2nd time.First time i just restarted the server and the problem was solved, now the issue came back again after couple of weeks. This time i didnt tried restarting instead am trying to find the cause. Since am planning to have more users in my site i think its not fair to keep on restarting the server.
I belive my wp-config is fine.At this stage i tried to test the db connection using following piece of code.
`<?php
$link = mysql_connect('localhost', '*******', '*****');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>`
and added this file to my www folder. when i run the file shows "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)" Can someone please help me with this...
Thanks in advance :)