I have problem with my Wordpress site, it was working normally, Suddenly this message start to appear
Error establishing a database connection Wordpress
I tried the following things (no one is working and I still have the same problem till now)
I checked my wp_config.php for db name and credential and every thing is fine and I tried to repair db by adding WP_ALLOW_REPAIR and this scripts shows that every thing is okay.
I added test file to my website to see if the db credentials is correct like following
<?php
$link = mysql_connect('localhost', 'myUserName', 'myPassword');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
and it's print Connected successfully
I tried to disable plugins by changing the name of the plugins folder, but same problem.