3

I have the classic many connections error in my MySQL app:

exception 'PDOException' with message 'SQLSTATE[HY000] [1129] Host 
'[IP ADDRESS]' is blocked because of many connection errors; unblock 
with 'mysqladmin flush-hosts'' in /var/www/libs/Database.php:15

There's plenty written on what causes this and how to solve it by increasing the limit, but what I haven't been able to determine is how to debug my code. I'd prefer to close the connection rather than have a load in use.

Is there any way to query MySQL to determine where connections are coming from and how long they have been open?

alias51
  • 8,178
  • 22
  • 94
  • 166
  • 1
    http://stackoverflow.com/questions/7432241/mysql-show-status-active-or-total-connections Maybe this helps a bit – Anyone Jan 08 '14 at 19:25
  • possible duplicate of [How can I view live MySQL queries?](http://stackoverflow.com/questions/568564/how-can-i-view-live-mysql-queries) – Mike B Jan 08 '14 at 19:26

1 Answers1

2
show processlist 

from the mysql cli this will show you the list of processes running, what commands they are running, and what IPs they are connected from.

Zak
  • 24,947
  • 11
  • 38
  • 68