免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5447 | 回复: 2
打印 上一主题 下一主题

show global variables和show variables得出的结果疑问 [复制链接]

论坛徽章:
3
数据库技术版块每日发帖之星
日期:2016-05-27 06:20:00数据库技术版块每日发帖之星
日期:2016-06-04 06:20:00数据库技术版块每日发帖之星
日期:2016-06-23 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-06-23 11:00 |只看该作者 |倒序浏览
root@host01 conf]# more /db/mysqlmha/conf/my.cnf
[mysqld]
server_id=1
log-bin=binlog
log-bin-index=binlog.index
port=3306
basedir=/db/mysqlmha
datadir=/db/mysqlmha/data
socket=/db/mysqlmha/mysql.sock
character-set-server=utf8
max_connections = 1500
show_compatibility_56=on
wait_timeout=600

配置文件里设置的wait_timeout为600


使用show global variables查出来的是600,说明这个是读取配置文件的
mysql> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 600   |
+---------------+-------+
1 row in set (0.01 sec)

使用show variables查出来的是28800,请问这个值是从那里读取的呢? 我也想用show variables查出的值是600,需要怎么呢?
mysql> show  variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

论坛徽章:
93
2015年辞旧岁徽章
日期:2019-10-10 10:51:15CU大牛徽章
日期:2014-02-21 14:21:56CU十二周年纪念徽章
日期:2020-10-15 16:55:55CU大牛徽章
日期:2014-02-21 14:22:07羊年新春福章
日期:2019-10-10 10:51:39CU大牛徽章
日期:2019-10-10 10:55:38季节之章:春
日期:2020-10-15 16:57:40ChinaUnix元老
日期:2019-10-10 10:54:42季节之章:冬
日期:2019-10-10 10:57:17CU大牛徽章
日期:2014-02-21 14:22:52CU大牛徽章
日期:2014-03-13 10:40:30CU大牛徽章
日期:2014-02-21 14:23:15
2 [报告]
发表于 2016-06-23 11:55 |只看该作者
回复 1# hxl


参考:
    https://dev.mysql.com/doc/refman ... sysvar_wait_timeout
The number of seconds the server waits for activity on a noninteractive connection before closing it.

On thread startup, the session wait_timeout value is initialized from the global wait_timeout value or from the global interactive_timeout value, depending on the type of client (as defined by the CLIENT_INTERACTIVE connect option to mysql_real_connect()). See also c.


你 show variables 的时候是显示的当前的会话变量,两个不是同一个内容。具体没有深究,你试试看 interactive_timeout 这个配置调整看看。

求职 : Linux运维
论坛徽章:
203
拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:57:092015小元宵徽章
日期:2015-03-06 15:58:182015年亚洲杯之约旦
日期:2015-04-05 20:08:292015年亚洲杯之澳大利亚
日期:2015-04-09 09:25:552015年亚洲杯之约旦
日期:2015-04-10 17:34:102015年亚洲杯之巴勒斯坦
日期:2015-04-10 17:35:342015年亚洲杯之日本
日期:2015-04-16 16:28:552015年亚洲杯纪念徽章
日期:2015-04-27 23:29:17操作系统版块每日发帖之星
日期:2015-06-06 22:20:00操作系统版块每日发帖之星
日期:2015-06-09 22:20:00
3 [报告]
发表于 2016-06-23 17:42 |只看该作者
一个global级别,一个session级别,当然不同
wait_timeout=100
interactive_timeout=100

connect_timeout = 20
slave-net-timeout=30
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP