views:

36

answers:

1

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 have any suggestion to set permanently session system variable?

+2  A: 

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.

Paul Dixon