zoukankan      html  css  js  c++  java
  • mysql查看和设置timeout 和批量杀死链接进程

    查看的语句

    show global variables like "%timeout%";

    结果:

    +-----------------------------+----------+

    | Variable_name               | Value    |

    +-----------------------------+----------+

    | connect_timeout             | 60       |

    | delayed_insert_timeout      | 300      |

    | innodb_flush_log_at_timeout | 1        |

    | innodb_lock_wait_timeout    | 50       |

    | innodb_rollback_on_timeout  | OFF      |

    | interactive_timeout         | 28800    |

    | lock_wait_timeout           | 31536000 |

    | net_read_timeout            | 30       |

    | net_write_timeout           | 60       |

    | rpl_stop_slave_timeout      | 31536000 |

    | slave_net_timeout           | 3600     |

    | wait_timeout                | 100      |

    +-----------------------------+----------+

     

    修改的语句:

    Set global connect_timeout=100;

     处理超时链接时批量杀死进程:

    --查看进程数量

    SHOW PROCESSLIST;

    show variables like '%timeout%';
    -- 批量处理超时链接
    SELECT concat('KILL ',id,';') FROM information_schema.processlist WHERE user='sxzz';

    通过生成的kill语句执行杀死进程。

    例如:

    KILL 3104;

     

  • 相关阅读:
    django email用法
    django ImageField用法
    django集成微博内容
    python读写zip文件
    读写文件
    404渲染
    bzoj1297 / P4159 [SCOI2009]迷路
    bzoj1009 / P3193 [HNOI2008]GT考试
    poj2115 C Looooops(exgcd)
    bzoj1407 / P2421 [NOI2002]荒岛野人(exgcd)
  • 原文地址:https://www.cnblogs.com/gynbk/p/6907405.html
Copyright © 2011-2022 走看看