开发者

Change Permanently Session System Variable in MySQL

开发者 https://www.devze.com 2023-01-14 18:41 出处:网络
I added this line to my.ini wait_timeout=2000000 When I type show global variables It prints wait_timeout=2000000,

I added this line to my.ini

wait_timeout=2000000

When I type

show global variables

It prints wait_timeout=2000000,

but when I type

show variables

It prints wait_timeout=28800

I can set with

set wait_timeout=2000000

But I do not want to set it all the time manually.

Do you开发者_StackOverflow社区 have any suggestion to set permanently session system variable?


You probably need to check the interactive_timeout is set also - regular client connections are probably picking up your new setting, but when you check it manually using an interactive client, MySQL will set the timeout from this setting:

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 interactive_timeout.

See manual for details.

0

精彩评论

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