7
如何在H2/MySQL中查找活動的打開的數據庫連接數。我們需要這些信息來確定是否存在連接泄漏。如何在H2/MySQL中查找打開的數據庫連接的活動數
如何在H2/MySQL中查找活動的打開的數據庫連接數。我們需要這些信息來確定是否存在連接泄漏。如何在H2/MySQL中查找打開的數據庫連接的活動數
對於H2,使用方法:
select * from information_schema.sessions;
對於MySQL,使用:
show full processlist;
或
select * from information_schema.processlist;
如果您在會話計數只是感興趣,請select count(*)
代替select *
select * from information_schema.sessions; ID \t \t USER_NAME在session_start \t \t STATEMENT STATEMENT_START \t USER1 2011-05-27 09:09:44.98 \t \t空2011-05-27 09:09:48.139 \t USER1 2011-05-27 10: 56:32.769 \t select * from information_schema.sessions \t 2011-05-27 10:56:34.316 – Joe 2011-05-27 05:27:52
當我運行上述SQL語句時,我得到了上述信息,但沒有獲取有關連接數的信息。我錯過了什麼 – Joe 2011-05-27 05:28:36
'select count(*)from information_schema.sessions;' 'select count(*)from information_schema.processlist;' – 2011-05-27 06:30:57