0

To list active connections we do:

show processlist;

What to do to list old closed connections?

mmonem
  • 2,811
  • 2
  • 28
  • 38
  • That information is hardly going to be stored. What do you need this for? – Pekka Aug 22 '10 at 09:53
  • I have created a php that created 'too many connections' yesterday and I need to do heavy inspection about the issue – mmonem Aug 22 '10 at 09:57
  • I don't think that is possible. Maybe the top answer to this question gives some pointers what to do: http://stackoverflow.com/questions/1202322/mysql-error-too-many-connections – Pekka Aug 22 '10 at 10:03

2 Answers2

2

The simple answer is that there's nothing provided by MySQL to list old connections. But you could capture the data flowing between your web front end and your database:

tcpdump -i eth0 -s 0 -w /tmp/mysql.cap tcp port 3306

run your PHP, have it fail, stop the capture and use Wireshark to see exactly what was going on.

David Knell
  • 745
  • 4
  • 6
  • Thanks for your answer +1 but apache runs on the same server as mysqld and it does not connect using sockets. – mmonem Aug 22 '10 at 13:19
0

I could obtain this nice answer from serverfault.

Community
  • 1
  • 1
mmonem
  • 2,811
  • 2
  • 28
  • 38