Edit report at https://bugs.php.net/bug.php?id=51085&edit=1

 ID:                 51085
 Comment by:         m dot mihailko at gmail dot com
 Reported by:        djokodonev at gmail dot com
 Summary:            Mysql Connect takews too long
 Status:             Not a bug
 Type:               Bug
 Package:            Performance problem
 Operating System:   windows 7
 PHP Version:        5.3.1
 Block user comment: N
 Private report:     N

 New Comment:

I have the similar problem. Do you find a solution?


Previous Comments:
------------------------------------------------------------------------
[2010-02-18 23:59:47] djokodonev at gmail dot com

Yes,

Well there isn't any load on the Machine, neither queries slow or any.

Already tried disabling the Firewall it gave no result. 

Tried entering "localhost", 127.0.0.1, "localhost:3306", etc. They all gave the 
same result. So it is not a DNS issue? as far as i can tell. 

But just in case i have the localhost added in the 
win/system32/drivers/etc/hosts file mapping to 127.0.0.1


I've tried opening MYSQL from the command line(cmd) and it seems instantaneous  
connection compared to the 0.5 sec that takes php (mysql_connect) to connect.

NOTE that the Delay is always 0.5 sec. (+- 0.02) sec.

I simple doesn't makes sense but a lot of things don't i guess =).

And the configuration I am running is exactly thee same one as before. I triple 
or checked at least 10 times. I've been playing with this for at least 4 days 
now. 

Now I don't think that i can find a book or go to seminar or anything that i 
offered on the php support page. 

Anyways it is not bogus... Maybe it is MYSQL related not php related but you'll 
be getting such requests a lot in the coming months with people going over to 
WIN 7.

I've tried all the Google Related pages to look up a solution to this problem 
and tried installing a few versions of php and mysql to test out whether there 
is any difference if one would work compared to other WITHOUT ANY RESULTS. 

And it would have been great if I could actually see where the delay is.. If it 
in the computer or something needs to be tweaked.. et. but i have no idea on 
how to do that.

------------------------------------------------------------------------
[2010-02-18 17:42:09] ahar...@php.net

-Status: Open
+Status: Bogus

This looks broadly similar (albeit on a different OS) to bug #48051, which 
wasn't a PHP issue as such either. Try disabling any firewalls you have 
enabled, check that MySQL isn't under undue load, see if connections from other 
applications (such as the MySQL command line client) also have a similar delay, 
et cetera.

At any rate, your problem does not imply a bug in PHP itself. For a list of 
more appropriate places to ask for help using PHP, please visit 
http://www.php.net/support.php as this bug system is not the appropriate forum 
for asking support questions.

Thank you for your interest in PHP.

------------------------------------------------------------------------
[2010-02-18 16:52:28] djokodonev at gmail dot com

-Bug Type: Documentation problem
+Bug Type: Performance problem

It's a Performance problem...

------------------------------------------------------------------------
[2010-02-18 16:45:09] djokodonev at gmail dot com

Description:
------------
The mysql_connect function takes too long to connect to the host.

As shown below, the example code I've written, makes a connection to the local 
database(mysql) running on port 3306.

It worked just fine before i upgraded to windows 7.. It is quite possible that 
this is OS related than php related but still.

I would surely appreciate any feedback.

Regards

Reproduce code:
---------------
---
>From manual page: http://www.php.net/function.mysql-connect#Parameters
---

// Test Code
$start = microtime(true);

$conect = mysql_connect("127.0.0.1:3306", "root", "myPassword");
$end = microtime(true);

echo $end - $start;//  0.500825881958 sec.

// results is -> 0.500825881958 sec...??? it is taking too long to connect for 
some reason??? Is it PHP related or?



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=51085&edit=1

Reply via email to