tags:

views:

41

answers:

1

I am using MySQL on wamp server. It takes 0.6 secs to establish a connection with mysql database, however when I use persistence connection it takes 0.035 secs. I read people comments on php manual and found that mysql_pconnect runs out of connections soon. Any suggestion how to improve connectivity time?

+1  A: 

There's no way it should take 0.6 seconds. Slow connection time is almost always related to DNS lookups.

Try starting your MySQL Server with skip_name_resolve option enabled in your my.ini file.


Re your comments that you cannot connect: It's hard to guess the reason for this because there are so many reasons for a connection failure.

There are other connection troubleshooting steps, but they depend on the nature of the failure. Can you be more specific about what error message you're getting?

Bill Karwin
MySQL started fine but now i can not connect to database. I put it under mysqld option
jason
See http://serverfault.com/questions/15073/remote-connection-to-mysql-server-takes-very-long
Bill Karwin
I did exactly that mysql started fine but my script is unable to connect with database. I used 127.0.0.1 and localhost none of them is working. MySQL is on same machine.
jason
I just figured out it says access denied for user [email protected], wondering why odbc instead root?
jason
On Windows, the MySQL client assumes "odbc" as a default user if you don't specify any user.
Bill Karwin
I changed the host to ALL for the root user and it worked fine. But the issue is still same, it takes 0.5 secs to establish a connection with database :(
jason