Skip to content

Instantly share code, notes, and snippets.

@goyuninfo
Created November 26, 2013 16:37
Show Gist options
  • Save goyuninfo/7661551 to your computer and use it in GitHub Desktop.
Save goyuninfo/7661551 to your computer and use it in GitHub Desktop.
'''
@author: it.i88.ca
'''
import MySQLdb
import time
db = MySQLdb.connect(host="192.168.1.19", user="i88ca", passwd="i88ca", db="i88ca")
#create a cursor for the select
cur = db.cursor()
while (True):
cur.execute("show processlist;")
for row in cur.fetchall() :
# print row[0], row[1]
print row[7]
time.sleep(8);
# close the cursor
cur.close()
# close the connection
db.close ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment