26Oct/100
MySQL show status – Matar procesos colgados
Primero es ver cuantas conexiones a nuestro Mysql tenemos
mysql> show status like 'Conn%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | Connections | 8 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show status like '%onn%'; +--------------------------+-------+ | Variable_name | Value | +--------------------------+-------+ | Aborted_connects | 0 | | Connections | 8 | | Max_used_connections | 4 | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_finished_connects | 0 | | Threads_connected | 4 | +--------------------------+-------+ 7 rows in set (0.00 sec)
Vamos a ver los procesos en ese momento
mysql> show processlist; +----+------+-----------------+--------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+--------+---------+------+-------+------------------+ | 3 | root | localhost | webapp | Query | 0 | NULL | show processlist | | 5 | root | localhost:61704 | webapp | Query | 208 | | NULL | | 6 | root | localhost:61705 | webapp | Sleep | 208 | | NULL | | 7 | root | localhost:61706 | webapp | Sleep | 208 | | NULL | +----+------+-----------------+--------+---------+------+-------+------------------+ 4 rows in set (0.00 sec
Ahora vamos a suponer que ya no necesitamos el proceso numero 5 (Id) o que este esta colgado.
Kill ID
o si se encontrara ejecutandose y necesitamos terminando de todos modos
kill query ID