For a long time, the local PHP environment, with localhost connection MySQL, as long as the access to query the database page, there will be slow response to the phenomenon, find some information has not been resolved.
Today, a sudden use of IP connection, hair down speed unexpectedly much faster, friends came to help see the next.
Check the Hosts file, found 127.0.0.1 did not parse to localhost, suddenly dawned ah.
Did not parse the past, the response speed of course slow, it each time to find their own.
The second is to modify the Mysql.default_host in the php.ini configuration file and write the first argument in mysql_connect () as an empty string; This method has not been tested successfully, it may be that I have neglected some places ~ ~
remote connection MySQL slow
The main reason for this problem is that MySQL, which is installed by default, turns on DNS reverse resolution, adding skip-name-resolve to [mysqld] of files under My.ini (Windows System) or MY.CNF (Unix or Linux systems) Save.
Start-"Run"-"cmd--" net stop mysql-"net start mysql--" Haha, successful
My.ini path such as: D:\Program files\mysql\mysql Server 5.0\my.ini
The original is the problem of MySQL, so the operation can not be used in the MySQL authorization table in the host name and can only use IP.