Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I already had this issue on my Windows 2008 Server and I was able to solve it the following way:

  • Add localhost to Windows hosts file
  • Add skip-name-resolve to my.ini

It's very weird that on Windows Server 2012 (IIS8) these tricks don't help.

Creating a connection using PHP/MySQLi to MySQL needs 1 seconds when using localhost as server name, to it needs 0.0001 seconds.

share|improve this question
Sounds like it's querying your DNS server for the hostname anyway (although the hosts entry should prevent that). Try logging DNS lookups to see if this is the case. – Oldskool Dec 28 '12 at 15:05

Set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents DWORD (32-bits) in your registry to the value 0x20 and then reboot the computer to prefer ipv4 above ipv6 (Reference:

share|improve this answer
Silly me, I should have known that... lol. Thank you for showing me that, I will try it out. – andreas May 3 '13 at 22:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.