I want to change the MySQL settings, namely, wait_timeout . I /etc/mysql/my.cnf appropriate line to the /etc/mysql/my.cnf file, I /etc/mysql/my.cnf overloading the server, but the settings are not applied and the old value remains. I haven’t found any files with settings that overlap this file in the system. Tell me, what else can be done or why the parameter does not change?

  • And in which section ([clients], [mysqld]) do you change the value of the wait_timeout directive and then how do you check the change of the directive? - cheops
  • @cheops changed in [mysqld]. Checked with the SHOW VARIABLES command. - user212277 9:04 pm

1 answer 1

according to the documentation :

It was determined by the CLIENT_INTERACTIVE pattern.

i.e., for an interactive client session (in which you check the value), the wait_timeout for the wait_timeout is taken to take the global variable interactive_timeout not the global variable wait_timeout .

thus, to change the wait_timeout for an interactive client, change the global value interactive_timeout .


but in order to check the value of this variable for non-interactive clients using the same client, execute the query non-interactively , like this:

 $ echo 'show variables like "wait_timeout"' | mysql 

again, verbose:

  • to set the session_timeout value for interactive sessions, change the global variable interactive_timeout
  • to set the session_timeout value for non-interactive sessions, change the global variable wait_timeout
  • Those. I set the new value in my.cnf not for wait_timeout, but for interactive_timeout. I am overloading the server. I go under the console to MySQL and with the help of SHOW VARIABLES I see that both variables (and wait_timeout and interactive_timeout) have taken the same new value. I quit the console of input of commands of a muscle and I enter non-interactively $ echo 'show variables like... and see the old unchanged value for wait_timeout and new for interactive_timeout. The question is ... And which of them will actually act when the client connects (from ++) to the database? How long to wait for a cliff? - user212277
  • Having established thus small values ​​for interactive_timeout I observe that connection all the same remains active. Those. Interactive_timeout is not valid, but wait_timeout is valid (and by default it is 8 hours). - user212277
  • the client can open a non-interactive connection, or it can be interactive (see a quote about the name of the parameter and function). for a non-interactive connection, the value for the session wait_timeout is taken from the global wait_timeout . for interactive connection, the value for the session wait_timeout is taken from the global interactive_timeout . - aleksandr barakin
  • supplemented the answer. - aleksandr barakin
  • Those. The answer to my question in essence is: "it is impossible to change the value of wait_timeout". - user212277