Forum Stats

  • 3,782,582 Users
  • 2,254,669 Discussions


MySQL client disconnection due to network drop doesn't release threads and shows in processlist

user13795778 Member Posts: 2
edited Nov 22, 2016 12:20AM in MySQL Community Space

Here is our case, say you connect to MySQL database over network using any client and the network connection is interrupted/dropped, the processlist still shows the connection. How do we determine if the client has disconnected or dropped? in the below example the client 764PNQ18861LT02 switched off network....

    Id  User    Host                   db                  Command    Time  State     Info                  

------  ------  ---------------------  ------------------  -------  ------  --------  -----------------------

     3  root    localhost:52801        performance_schema  Query         0  starting  show full processlist 

     4  xyz    764PNQ18861LT02:61945  (NULL)              Sleep      1239            (NULL)                


  • Dave Stokes-MySQL Community Team-Oracle
    Dave Stokes-MySQL Community Team-Oracle MySQL Community Manager TexasMember Posts: 370 Employee
    edited Nov 21, 2016 12:19PM

    You need to check the log files to determine if your network in lousy.

    And you can use mysqlprocgrep from the MySQL Utilities to search and kill these processes.

    Dave Stokes

    MySQL Community Manager

  • user13795778
    user13795778 Member Posts: 2
    edited Nov 22, 2016 12:20AM

    I was more looking for something like FLUSH command to clean-up all stale connections. The issue is people are connecting over wireless and LAN and sometimes if they take the laptop out of say dock, the network is interrupted and the connection becomes stale; the application reconnects however in MySQL processlist the old connection is still listed in sleep state, which you can't tell is active or waiting on client to execute further queries.