Home > Database > Mysql Tutorial > 设立Mysql的连接超时参数

设立Mysql的连接超时参数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:16:04
Original
938 people have browsed it

设置Mysql的连接超时参数 在Mysql的默认设置中,如果一个数据库连接超过8小时没有使用(闲置8小时,即 28800s),mysql server将主动断开这条连接,后续在该连接上进行的查询操作都将失败,将 出现:error 2006 (MySQL server has gone away)!。 查看mysql se

设置Mysql的连接超时参数
在Mysql的默认设置中,如果一个数据库连接超过8小时没有使用(闲置8小时,即

28800s),mysql server将主动断开这条连接,后续在该连接上进行的查询操作都将失败,将

出现:error 2006 (MySQL server has gone away)!。

查看mysql server超时时间:

   msyql> show global variables like '%timeout%';

设置mysql server超时时间(以秒为单位):

  msyql> set global wait_timeout=10;

  msyql> set global interactive_timeout=10;
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template