My wordpress blog, hosted on my IIS 7.5 Server
, suddenly lost his connection to localhost MySQL Database
with no apparent reason. Both public and wp-admin
links
Both public and wp-admin links throw an "Error establishing a database connection"
exception.
I have successfully verified host name, user name and password opening a new ODBC connection with MySQL ODBC 5.3
Unicode Driver entering the credentials defined under DB_HOST
, DB_USER
and DB_PASSWORD
at wp_config.php
.
I've also verified database is not corrupted since I can successfully browse the database from MySQL Workbench 6.3
IIS 7.5 application pool
is started.
I have tested wordpress connection with next code:
<?php
$link = mysql_connect('localhost', '(my user name)', '(my password)');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
which throws next result:
Could not connect: php_network_getaddresses: getaddrinfo failed: No such host is known.
If I change localhost
to 127.0.0.1
the code just returns
'Could not connect:'
and no error is displayed.
Any help will be apreciated