php Mysql setting timeout solution: first find and open the configuration file "php.ini"; then find the "mysql.connect_timeout" item in the file; finally modify the value to 2 or 3.
Recommended: "PHP Tutorial"
php connection mysql timeout problem
Phenomena:
When php establishes a connection with mysql, it waits for a long time, and finally reports that the script execution time exceeds the maximum value.
Source of the problem:
When PHP needs to connect to mysql, generally there will be no misconfiguration. If the machine where mysql is located is turned off, or there is a network problem, or the configuration is wrong, then you need to It will take a long time to know the result of the connection. The waiting time is determined by mysql.connect_timeout in php.ini (unit: seconds). It is recommended to set it to 2 or 3
The above is the detailed content of How to solve php mysql settings timeout problem. For more information, please follow other related articles on the PHP Chinese website!