数据库停止执行当前的任务

# 查询当前任务
show processlist
Id User Host db Command Time State Info Progress
73911 user 127.0.0.1:41780 databasename Sleep 175 NULL 0.000
73912 user 127.0.0.1:41782 databasename Sleep 175 NULL 0.000
73913 user 127.0.0.1:42130 databasename Sleep 115 NULL 0.000
73914 user 127.0.0.1:42132 databasename Sleep 175 NULL 0.000
73915 user 127.0.0.1:42208 databasename Sleep 115 NULL 0.000
73916 user 127.0.0.1:42210 databasename Sleep 115 NULL 0.000
73917 user 127.0.0.1:42212 databasename Sleep 55 NULL 0.000
73918 user 127.0.0.1:42300 databasename Sleep 55 NULL 0.000
73919 user 127.0.0.1:42302 databasename Sleep 55 NULL 0.000
73920 user 127.0.0.1:42304 databasename Sleep 0 NULL 0.000
73921 user localhost databasename Query 0 NULL show processlist 0.000

根据info字段(你执行的语句)找到对应的任务id,kill对应id即可

kill 73921

此时,执行的语句已经停止执行了

你可能感兴趣的:(数据库停止执行当前的任务)