Digital Marketing

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.


import MySQLdb
import time

db = MySQLdb.connect(host="", user="i88ca", passwd="", db="")
#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

Make online money from the Internet