12

Can anyone know the way to get the number of DB connection being used , in MYSQL 5.0

3 Answers3

24
SHOW STATUS WHERE variable_name = 'Threads_connected'
Quassnoi
  • 413,100
  • 91
  • 616
  • 614
3
Number of open connections can be found out by using below query:
   mysql -e 'SHOW STATUS WHERE variable_name LIKE "Threads_%" OR variable_name = "Connections"'

   +-------------------+-------+
   | Variable_name     | Value |
   +-------------------+-------+
   | Connections       | 862   |
   | Threads_cached    | 0     |
   | Threads_connected | 10    |
   | Threads_created   | 26    |
   | Threads_running   | 1     |
   +-------------------+-------+
Appy
  • 79
  • 3
3

12.5.5.31. SHOW PROCESSLIST Syntax

Shows you how many people are connected to the server.

  • Actually, i need to know how many DB connections have been opened so far –  May 05 '09 at 11:32
  • In That case you can use: SHOW STATUS WHERE variable_name = 'Threads_created'; And to see the maximum connections opened at any one time use SHOW STATUS WHERE variable_name = 'Max_used_connections'; –  May 05 '09 at 12:37