2011-05-26 21 views

回答

17

對於H2,使用方法:

select * from information_schema.sessions; 

對於MySQL,使用:

show full processlist; 

select * from information_schema.processlist; 

如果您在會話計數只是感興趣,請select count(*)代替select *

+0

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

+0

當我運行上述SQL語句時,我得到了上述信息,但沒有獲取有關連接數的信息。我錯過了什麼 – Joe 2011-05-27 05:28:36

+0

'select count(*)from information_schema.sessions;' 'select count(*)from information_schema.processlist;' – 2011-05-27 06:30:57

相關問題