Skip to content

Instantly share code, notes, and snippets.

@nghiahsgs
Created January 30, 2021 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nghiahsgs/fbd71beeabe11a980fba7bfa0f7ec7b7 to your computer and use it in GitHub Desktop.
Save nghiahsgs/fbd71beeabe11a980fba7bfa0f7ec7b7 to your computer and use it in GitHub Desktop.
kill process sleep mysql
mysql -u root -p -e "select concat('KILL ',id,';') into outfile '/var/lib/mysql-files/a.txt' from information_schema.processlist where Command = 'Sleep'"
mysql -u root -p -e "source /var/lib/mysql-files/a.txt"
rm -rf /var/lib/mysql-files/a.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment