MySQL的wait_timeout在SQLyog中不正确 [英] MySQL's wait_timeout incorrect in SQLyog

查看:208
本文介绍了MySQL的wait_timeout在SQLyog中不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题之后,我在(相当于Linux的my.cfg):

[mysqld]
wait_timeout=2147483

重新启动Windows后,我使用 SQLyog 来查看效果:

After restarting Windows I used SQLyog to see the effect:

  • SHOW SESSION VARIABLES LIKE 'wait_timeout'给出了28800
  • 的结果
  • SHOW GLOBAL VARIABLES LIKE 'wait_timeout'给出了2147483
  • 的结果
  • SHOW SESSION VARIABLES LIKE 'wait_timeout' gave a result of 28800
  • SHOW GLOBAL VARIABLES LIKE 'wait_timeout' gave a result of 2147483

为什么?我认为全局参数被用作每个新会话的默认值.

How come? I thought the global parameters are used as the default for each new session.

推荐答案

奖励:我已经阅读了sqlYog的源代码.

Bonus answer: I've gone through the source code of sqlYog.

这是feature:如果超时设置> 28800,则为硬编码 在CommonHelper.cpp中将会话超时更改为28800.

It's a feature: if the timeout setting > 28800, it is hardcoded to change the session timeout to 28800 in CommonHelper.cpp.

3314   //Session wait_timeout3315   timeout = conn->m_strwaittimeout.GetAsUInt32();
3316 
3317   if(timeout > 28800 || timeout <= 0)
3318     conn->m_strwaittimeout.SetAs("28800");
3319 
3320   strtimeout.Sprintf("/*!40101 set @@session.wait_timeout=%s */", conn->m_strwaittimeout.GetString());
3321   mysql_options(*pmysql, MYSQL_INIT_COMMAND, strtimeout.GetString());

这说明了您所看到的.

这篇关于MySQL的wait_timeout在SQLyog中不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆