Home  >  Article  >  Database  >  mysql修改wait

mysql修改wait

WBOY
WBOYOriginal
2016-06-07 15:20:591529browse

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 mysql修改wait_timeout mysql mysql show global variables like 'wait_timeout'; 其默认值为8小时 mysql的一个connection空闲时间超过8小时,mysql会自动断开该连接。 1.修改配置 vi /etc/my.cnf [m

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  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断开

mysql修改wait

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