We’re using MySQL in a shared environment and have periodically experienced “too many connections” problems. As I try to diagnose this, everyone seems to recommend SHOW PROCESSLIST or checking the ‘Threads_connected’ variable in the SHOW STATUS output. All of the references I’ve found imply that both of these display equivalent information, ie that ‘threads_connected’ should match the number of entries returned by SHOW PROCESSLIST, but in all my tests SHOW PROCESSLIST only shows one entry while ‘threads_connected’ fluctuates between 3 and 10.
My hunch is that SHOW PROCESSLIST is only displaying my connections while ‘threads_connected’ is showing a thread count for all users, but I haven’t been able to find anything that positively states this. So what’s the deal?
See the doc:
http://dev.mysql.com/doc/refman/5.6/en/show-processlist.html
and in particular:
”
If you have the PROCESS privilege, you can see all threads. Otherwise, you can see only your own threads (that is, threads associated with the MySQL account that you are using)
“