有没有办法直接从php获取mysql的wait timeout?
最佳答案
只需进行一个普通的 mysql 查询即可。
mysql> show variables where Variable_name='wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.07 sec)
在 PHP 中它看起来像这样。
// it's been a while to there might be typos
$res = mysql_query("show variables where Variable_name='wait_timeout'");
$arr = mysql_fetch_assoc($res);
echo $arr['Variable_name'];
echo $arr['Value'];
关于php - 从php获取mysql等待超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5740987/