Joe
Joe

Reputation: 15339

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 identify if there are any connection leaks.

Upvotes: 8

Views: 15330

Answers (1)

Thomas Mueller
Thomas Mueller

Reputation: 50107

For H2, use:

select * from information_schema.sessions;

For MySQL, use:

show full processlist;

or

select * from information_schema.processlist;

If you are just interested in the session count, use select count(*) instead of select *

Upvotes: 19

Related Questions