Created
November 26, 2013 16:37
-
-
Save goyuninfo/7661551 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
@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