Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mysql:scripts [2008/10/31 23:31]
a created
mysql:scripts [2009/05/25 00:35]
Line 1: Line 1:
-===== Kill every MySQL SELECT older than X seconds ===== +
-<code bash|f kill.sh> +
-#!/bin/bash +
-SEC=$1 +
-IFS=’|’ +
-if [[ $SEC -lt 1 ]]; then +
-   echo “Usage: $0 SECONDS” +
-   exit 1 +
-fi +
-mysqladmin proc -v|grep Query|grep -Evi “delete|update|insert|alter table” |while read dummy qid qusr qhost qdb qstat qsec qstat2 query +
-do +
-   if [ $qsec -gt $SEC ]; then +
-      echo “Killing query $qid…” +
-      mysqladmin kill $qid +
-   fi +
-done +
-</code>+
mysql/scripts.txt · Last modified: 2009/05/25 00:35 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready