0

Hello! I've recently installed Windows 8 and since that moment my XAMPP installation has been acting a bit weird it takes over a second to establish a mysql connection (mysql_connect) where it used to take less than 0.01 seconds.Timed:

Timer 1 (mysql_connect): 1.02864
Timer 2 (select_db): 0.00023

I have found a solution: instead of using mysql_connect('localhost'...) I use mysql_connect('127.0.0.1'...). New timers:

Timer 1 (mysql_connect): 0.00446
Timer 2 (select_db): 0.00023

However, I want to be able to just connect to localhost! :) I've checked my hosts file. It does contain a line saying "127.0.0.1 localhost" and the line "::1 localhost" (the ipv6 variant) has been commented out with a #. It's just not working. Any suggestions?

Edited by minitauros

2
Contributors
3
Replies
6
Views
5 Years
Discussion Span
Last Post by LastMitch
0

I've checked my hosts file. It does contain a line saying "127.0.0.1 localhost" and the line "::1 localhost" (the ipv6 variant) has been commented out with a #. It's just not working. Any suggestions?

This is your localhost:

127.0.0.1

If you have a file called 'index.php'

just type this on your browser 127.0.0.1/index.php

then that file will appear.

0

Hey LastMitch, thanks for your reply! The point is: I want to be able to use "localhost" everywhere, as I'm used to, instead of "127.0.0.1". Many users reporting the same slow mysql_connect problem have been told to edit their hosts file and add the line I was talking about to it. For me, the line was already there, so it did not solve my problem. Anything else I can do to get rid of having to type 127.0.0.1 instead of "localhost"? :)

Edited by minitauros

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.