Home >Database >Mysql Tutorial >mysql修改wait_timeout_MySQL

mysql修改wait_timeout_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:29:442350browse

bitsCN.com

mysql修改wait_timeout

 

mysql mysql> show global variables like 'wait_timeout'; 

 

其默认值为8小时 

mysql的一个connection空闲时间超过8小时,mysql会自动断开该连接。 

 

1.修改配置 vi /etc/my.cnf [mysqld] wait_timeout=10 # /etc/init.d/mysql restart 2.直接用sql命令行修改 mysql> set global wait_timeout=10; mysql> show global variables like 'wait_timeout'; +----------------------------+-------+ | Variable_name              | Value | +----------------------------+-------+ | wait_timeout               | 10    | +----------------------------+-------+ show variables like '%time%'; timeBetweenEvictionRunsMillis = 20000 #dbcp每2000秒进行一次connection的检 minEvictableIdleTimeMillis = 28700 #每次检验中将超过28700秒处于空闲的connection断开 

 


bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn