Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

mysql_connect works fine with 127.0.0.1, but not with localhost

$
0
0

Hi!


I set up my IIS 8 with PHP 5.3.3 and MySQL 5.0.24 as I used it before with Windows XP. Now I got the following problem. As I try to connect to mysql via a php-script using the command "mysql_connect" with the server parameter "localhost", I get an error "2002 - no response for a certain period..." (I translated from german so I don't know the exact text).

After a while I tried to connect using the server parameter "127.0.0.1" and it works!

As many of my web projects use "localhost" as server parameter I'd like to get this problem solved. Does anybody know, why I can't connect via "localhost"? I also tried to edit the "hosts"-file in C:\Windows\System32\Drivers\etc and added the following line:

localhost   127.0.0.1

but it doesn't help. I found a tutorial that explained to manage the hosts via the IIS-Management-Console - it says I should open the "Manage Local Hosts" - I can't find this entry in my german version of Windows 8. Does anybody know how I can find it?

Also restarting didn't help...

Thanks for any help!


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>