My database scripts were all hanging after an upgrade from PHP 5.2.8 to 5.3.1 on Windows. Turns out it’s a problem with the new MySQLnd library that doesn’t like IPv6. You need to comment out the line in C:\Windows\system32\drivers\etc\hosts that resolves ::1 to localhost.
Thanks to Corey Gilmore for documenting it; I figure the more people get it online the quicker it will be for people to find it.