Skip to content

Instantly share code, notes, and snippets.

@nikhilw
Last active March 3, 2017 14:27
Show Gist options
  • Save nikhilw/2a64c1d1d7b6952b7b8cac0f6ed67df2 to your computer and use it in GitHub Desktop.
Save nikhilw/2a64c1d1d7b6952b7b8cac0f6ed67df2 to your computer and use it in GitHub Desktop.

Revisions

  1. nikhilw revised this gist Mar 3, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions kill-mysql-connections.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    #! /bin/bash

    mysql -u root -proot -e "select id from information_schema.processlist;" | grep -e [0-9] | while read in; do mysql -u root -proot -e "kill $in"; done

    echo "verify"
    mysql -u root -proot -e "select count(id )from information_schema.processlist;"
  2. nikhilw created this gist Mar 3, 2017.
    3 changes: 3 additions & 0 deletions kill-mysql-connections.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    #! /bin/bash

    mysql -u root -proot -e "select id from information_schema.processlist;" | grep -e [0-9] | while read in; do mysql -u root -proot -e "kill $in"; done