Jauzsika
Jauzsika

Reputation: 3251

mysqlnd mysql_connect takes ages to connect

I'm deploying a new php project on a Windows based host and the big problem is, that mysql_connect takes literally ~1 second to connect to the mysql server on localhost each time. What the heck could be the problem?

PHPINFO says:

Client API version mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $

No matter, what I try - PDO, mysqli or plain old mysql_connect - the connect time remains the same. What I noticed tho, that every mysql plugin (PDO, mysqli, mysql_connect) shows the same mysqlnd revision. Shall I ask the admin to nuke mysqlnd or this can be tuned somehow?

Upvotes: 0

Views: 425

Answers (1)

Tak
Tak

Reputation: 11704

It could be taking a while to resolve localhost - try connecting to 127.0.0.1 instead.

Upvotes: 2

Related Questions