mysqladmin –user=root –password=mysqlpass processlist -i 1
is a great thing 🙂
shows how many mysql connection/process open in server
specially in python mysql you can get errors like this:
OperationalError: (1040, ‘Too many connections’)
this means you have many connection open and they are not closed.
from above command you can check how many connection are open and even check what python code is causing this by trying different python code while that command is running to see which increases the idle open connection.
Then you can change your python code so it closes the cursor and the connection right after finishing the task in mysql.