I’m trying to connect to MySQL from PHP (WordPress) on Windows / IIS 7.5 and this is what happens:
define('DB_HOST', 'DevPC'); // -> works
define('DB_HOST', 'localhost'); // -> connection error
Strange is that on another machine (Windows Server + IIS 7.5), localhost works just fine. What can be causing this? Some PHP settings? MySQL settings?
You should give us the error output from the connection. Are you sure it’s not a user access problem? Remember that
user@DevPCis not the same asuser@localhostwhen connecting to mysql. Even if both hostnames translates to the same IP.