Linux下mysql修改连接超时
 
1,首先进入mysql,查看 wait_timeout、interactive_timeout这个值是否为默认的8小时(即 28800) 
[root@server110 ~]# mysql -u root -p 
Enter password: 
输密码进入 
执行如下命令 
show variables like '%timeout%'; 
+----------------------------+-------+ 
| Variable_name              | Value | 
+----------------------------+-------+ 
| connect_timeout            | 10    | 
| delayed_insert_timeout     | 300   | 
| innodb_lock_wait_timeout   | 50    | 
| innodb_rollback_on_timeout | OFF   | 
| interactive_timeout        | 28800 | 
| net_read_timeout           | 30    | 
| net_write_timeout          | 60    | 
| slave_net_timeout          | 3600  | 
| table_lock_wait_timeout    | 50    | 
| wait_timeout               | 28800 | 
+----------------------------+-------+ 
如下表所示,说明连接超时时间使用的是默认的8小时 
修改之 
2.在mysql 5以上的版本需要修改my.cnf这个文件,这个文件的位置在 
/etc/my.cnf 
在[mysqld]后面加上如下两句话 
wait_timeout=388000 
interactive_timeout=388000 
3.下面重启下mysql 
service mysqld restart 
显示如下内容 
停止 MySQL:                                               [确定] 
启动 MySQL:                                               [确定] 
现在你可以在用1的方法,查看下这两个参数的值 
+----------------------------+--------+ 
| Variable_name              | Value  | 
+----------------------------+--------+ 
| connect_timeout            | 10     | 
| delayed_insert_timeout     | 300    | 
| innodb_lock_wait_timeout   | 50     | 
| innodb_rollback_on_timeout | OFF    | 
| interactive_timeout        | 388000 | 
| net_read_timeout           | 30     | 
| net_write_timeout          | 60     | 
| slave_net_timeout          | 3600   | 
| table_lock_wait_timeout    | 50     | 
| wait_timeout               | 388000 | 
+----------------------------+--------+ 
OK,修改好了 

mysql设置连接等待时间(wait_timeout)的更多相关文章

  1. Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep linux下mysql修改连接超时wait_timeout修改后就ok了

    Linux下mysql修改连接超时wait_timeout 1,首先: show variables like '%timeout%': 显示结果: +------------------------ ...

  2. mysql设置连接超时时间参数:wait_timeout

    [root@ ~]# mysql -h 192.168.0.* -uroot -pEnter password: Welcome to the MySQL monitor. Commands end ...

  3. Ubuntu下mysql修改连接超时wait_timeout

    命令行登入mysql show variables like '%timeout%':(其中有用的是: interactive_timeout  和wait_timeout  为28800,默认为8小 ...

  4. MySQL 的连接时长控制--interactive_timeout和wait_timeout

    在用MySQL客户端对数据库进行操作时,如果一段时间没有操作,再次操作时,常常会报如下错误: ERROR 2013 (HY000): Lost connection to MySQL server d ...

  5. mysql设置更改root密码、mysql服务器的连接、mysql常用命令

     1.设置更改root密码 查看mysql 启动与否,若没启动就运行:/usr/local/mysql56/bin/mysqlps aux |grep mysql  或 netstat -tulnp ...

  6. MySQL设置远程连接

    Window下MySQL设置开启远程连接mysql数据库 1.新建用户远程连接mysql数据库grant all on *.* to admin@'%' identified by '123456' ...

  7. (转)Linux开启mysql远程连接的设置步骤

    Mysql默认root用户只能本地访问,不能远程连接管理mysql数据库,Linux如何开启mysql远程连接?设置步骤如下: 1.GRANT命令创建远程连接mysql授权用户itlogger mys ...

  8. mysql设置指定ip远程访问连接的方法

    本文实例讲述了mysql设置指定ip远程访问连接的方法,分享给大家供大家参考.具体实现方法如下: 1. 授权用户root使用密码jb51从任意主机连接到mysql服务器: 复制代码 代码如下: GRA ...

  9. navicat软件设置连接mysql数据库

    navicat软件设置连接mysql数据库 适用范围及演示使用工具 适用范围:mysql全部系列(含Linux和Windows系统下的mysql) 演示使用工具:Navicat 8.0 MySQL 演 ...

随机推荐

  1. cf D. Queue

    http://codeforces.com/contest/353/problem/D #include <cstdio> #include <cstring> #includ ...

  2. linux sar查看网络流量

    sar -n DEV 1 10 -n { keyword [,...] | ALL } Report network statistics. IFACE Name of the network int ...

  3. c#发送邮件样例

    1.通过gmail邮箱发送邮件 try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient(& ...

  4. POJ 3378

    题目链接 查找长度为5的上升序列总数 用的树状数组+高精度 用树状数组求在i前面比i小的数有几个 用的4个树状数组,A[i][j]表示长度为i的以j为结尾的个数,A[i][j]=A[i-1][1... ...

  5. hdu 5400 Arithmetic Sequence(模拟)

    Problem Description A sequence b1,b2,⋯,bn are called (d1,d2)-arithmetic sequence ≤i≤n) such that ≤j& ...

  6. android推送-PHP(第三方推送:个推)

    在项目初期,就安卓推送功能怎么做,曾经参考过例如XMPP之类的推送方法.但苦于那些是些英文档案,又没太多时间研究,所以打算采用第三方推送(个推,极光推送等),后来在美图技术老大推荐下用采用个推. PS ...

  7. python3-day3(内置函数)

    1.内置函数 1>print(bytearray('王',encoding='utf8')) 2>print(bytes('王',encoding='utf8')) 3>bool(' ...

  8. Timus 1796. Amusement Park 聪明题

    On a sunny Sunday, a group of children headed by their teacher came to an amusement park. Aunt Frosy ...

  9. 安装tcmalloc

    安装google-perftools:#tar zxvf google-perftools-1.6.tar.gz #cd google-perftools-1.6 #./configure#make# ...

  10. Ubuntu 12.04设置打开远程桌面登录1

    teamviewer_linux.deb sudo dpkg --install teamviewer_linux.deb