waterye

show full processlist

shell
mysql -192.168.0.136 -3306 --u root -p'abcd' -'show full processlist' | egrep -'Sleep|show full processlist'
jsp
String sql = " show full processlist ";
rs
= stmt.executeQuery(sql);
while (rs.next()) {
String id
= rs.getString("Id");
String user
= rs.getString("User");
String host
= rs.getString("Host");
String db
= rs.getString("db");
String command
= rs.getString("Command");
String info
= rs.getString("Info");
String state
= rs.getString("State");
if (command.equalsIgnoreCase("Sleep")) continue;
if (info.equalsIgnoreCase("show full processlist")) continue;
if (info.length()==0 && state.length()==0) continue;
int time = rs.getInt("Time");
// print
}

posted on 2008-09-12 00:42 waterye 阅读(505) 评论(0)  编辑  收藏 所属分类: mysql


只有注册用户登录后才能发表评论。


网站导航: