How to find the active number of open database connections in H2 / MySQL

How to find the active number of open database connections in H2 / MySQL. We need this information to determine if there are communication leaks.

+7
source share
1 answer

For H2 use:

select * from information_schema.sessions; 

For MySQL use:

 show full processlist; 

or

 select * from information_schema.processlist; 

If you're just interested in session counting, use select count(*) instead of select *

+17
source

All Articles