mysql> show processlist;
+----+------+-----------------+-------+---------+------+----------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------------+-------+---------+------+----------+------------------+
| 58 | root | localhost:53324 | grimm | Sleep | 2326 | | NULL |
| 71 | root | localhost | grimm | Query | 0 | starting | show processlist |
+----+------+-----------------+-------+---------+------+----------+------------------+
2 rows in set (0.00 sec)
mysql> kill 58;
Query OK, 0 rows affected (0.00 sec)
mysql> show processlist;
+----+------+-----------+-------+---------+------+----------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+-------+---------+------+----------+------------------+
| 71 | root | localhost | grimm | Query | 0 | starting | show processlist |
+----+------+-----------+-------+---------+------+----------+------------------+
1 row in set (0.00 sec)
mysql> drop table activity;
Query OK, 0 rows affected (0.00 sec)
这是因为,在访问这个table的时候,出现了错误,但是没有rollback,导致这个进程一直占用这个表格。当把这个进程kill掉之后就可以删除了。