A simple python script to keep an eye on mysql process

The following codes are the same, they are just shown on different formats. Choose the one you like.

@author: it.goyun.info

import MySQLdb
import time

db = MySQLdb.connect(host="", user="i88ca", passwd="goyun.info", db="goyun.info")
#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]
# close the cursor
# close the connection
db.close ()


Popular posts from this blog

Check MySQL query history from command line

Installing chocolatey on Windows