开发者

Getting mysql wait timeout from php

开发者 https://www.devze.com 2023-02-27 06:51 出处:网络
Is there a way to get mys开发者_JAVA技巧ql wait timeout directly from php?Just make a normal mysql query.

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'];
0

精彩评论

暂无评论...
验证码 换一张
取 消