在配置文件里配置
wait_timeout=100
interactive_timeout=3600
请问mysql -p连接上数据库什么也不操作,是100秒后断开还是3600秒后断开连接

解决方案 »

  1.   

    wait_timeout的值是从interactive_timeout得到的  楼主可以 show variables like '%timeout%';并且随便开个客户端就可以自己测试下
      

  2.   

    wait_timeout 
    The number of seconds the server waits for activity on a noninteractive connection before closing it. This timeout applies only to TCP/IP and Unix socket file connections, not to connections made via named pipes, or shared memory. 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. 
    interactive_timeout 
    The number of seconds the server waits for activity on an interactive connection before closing it. An interactive client is defined as a client that uses the CLIENT_INTERACTIVE option to mysql_real_connect(). See also wait_timeout.