Getting mysql wait timeout from php
Is there a way to get mys开发者_JAVA技巧ql wait timeout directly from php?
Just make a normal mysql query.
mysql> show variables where Variable_name='wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.07 sec)
In PHP it'd look something like this.
// 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'];
精彩评论