Home > Database > Mysql Tutorial > mysql修改wait_timeout_MySQL

mysql修改wait_timeout_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:29:44
Original
2343 people have browsed it

bitsCN.com

mysql修改wait_timeout

 

mysql mysql> show global variables like 'wait_timeout'; 
Copy after login

其默认值为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断开 
Copy after login

 


bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template