14
Dec
Learn how to kill a hanging MySQL Client Process
First identify the hanging MySQL client process using the processlist command.
# mysqladmin -u root -ptmppassword processlist +----+------+-----------+----+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+----+---------+------+-------+------------------+ | 20 | root | localhost | | Sleep | 64 | | | | 24 | root | localhost | | Query | 0 | | show processlist | +----+------+-----------+----+---------+------+-------+------------------+
Now, use the kill command and pass the process_id as shown below. To kill multiple process you can pass comma separated process id’s.
# mysqladmin -u root -ptmppassword kill 20 # mysqladmin -u root -ptmppassword processlist +----+------+-----------+----+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+----+---------+------+-------+------------------+ | 26 | root | localhost | | Query | 0 | | show processlist | +----+------+-----------+----+---------+------+-------+------------------+