How to kill a session in mysql
Get the processid for the session:
mysql configurationintermediate
by MYSQL
12 views
Get the processid for the session:
123456789101112131415161718192021
mysql>
show processlist;
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
| Id | User | Host. | db | Command | Time | State | Info |
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
| 5 | event_scheduler | localhost | NULL | Daemon | 35192 | Waiting on empty queue | NULL |
| 24 | root | localhost | NULL | Query | 0 | init | show processlist |
| 25 | root | localhost | test | Sleep. | 6 | | NULL |
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
3 rows in set (0.00 sec)
mysql>
kill 25;
Query OK, 0 rows affected (0.00 sec)
mysql>
show processlist;
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
| Id | User | Host. | db | Command | Time | State | Info |
+----+-----------------+-----------+------+---------+-------+------------------------+------------------+
| 5 | event_scheduler | localhost | NULL | Daemon | 35192 | Waiting on empty queue | NULL |
| 24 | root | localhost | NULL | Query | 0 | init | show processlist |
mysql>Please to add comments
No comments yet. Be the first to comment!