查看MySQL正在执行的线程
一、使用SQL语句查询正在执行的线程
SHOW PROCESSLIST;
二、使用kill 线程id就可以结束线程(引起数据变化的线程需特别小心)
SHOW PROCESSLIST; +------+------+-----------------+---------+---------+------+----------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +------+------+-----------------+---------+---------+------+----------+------------------+ | 1415 | root | localhost:49483 | qskj_02 | Sleep | 143 | | NULL | | 1425 | root | localhost:61080 | NULL | Query | 0 | starting | SHOW PROCESSLIST | +------+------+-----------------+---------+---------+------+----------+------------------+ 2 rows in set (0.00 sec)