mysql - How to determine the correct number of connections -
i trying determine number of connections there on db, found following queries , results net , both have different outputs. can tell me figure correctly shows number of connections on db , how more details on these connections?
mysql> select substring_index(host, ':', 1) host_short, -> group_concat(distinct user) users, -> count(*) -> information_schema.processlist -> group host_short -> order count(*), -> host_short; +------------+-------------+----------+ | host_short | users | count(*) | +------------+-------------+----------+ | localhost | root,mailer | 7 | +------------+-------------+----------+ 1 row in set (0.01 sec) mysql> show status 'conn%'; +---------------+-------+ | variable_name | value | +---------------+-------+ | connections | 9885 | +---------------+-------+ 1 row in set (0.00 sec)
i found desire result using query bellow-
select db_name(dbid) dbname, count(dbid) connno, loginame login sys.sysprocesses dbid > 0 group dbid, loginame ;
Comments
Post a Comment