Tout d'abord, voyons comment identifier une session Locked Connexion à MySQL:

root@madb> mysql --defaults-file=/etc/mysql/debian.cnf
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8488
Server version: 5.1.44-ndb-7.1.4b (Debian)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show processlist; 
+------+------------------+-----------+------+---------+---------+-----------------------------------------------------------------------------+------------------+
| Id   | User             | Host      | db   | Command | Time    | State                                                                       | Info             |
+------+------------------+-----------+------+---------+---------+-----------------------------------------------------------------------------+------------------+
|    1 | system user      |           |      | Daemon  |       0 | Waiting for event from ndbcluster                                           | NULL             | 
|    3 | system user      |           | NULL | Connect | 3186221 | Slave has read all relay log; waiting for the slave I/O thread to update it | NULL             | 
|    8 | mon_user         |           | madb | Query   |   34735 | Locked                                                                      | SELECT * from ma |
| 8466 | debian-sys-maint | localhost | NULL | Query   |       0 | NULL                                                                        | show processlist | 
+------+------------------+-----------+------+---------+---------+-----------------------------------------------------------------------------+------------------+
4 rows in set (0.00 sec)

On peut voir que la connexion n°8 est en état "Locked".

Pour la stopper :

mysql > kill connexion 8;

Et voilà ! Adieu la vilaine connexion :)

A bientôt pour un nouveau billet ;)