Re: Number of connections to a database

2004-11-29 Thread Wolfram Kraus
Philippe de Rochambeau wrote:
Hello,
is there any way to tell the number of simultaneous connections to a 
mysql database at a given time, using SQL or a scripting language such 
as php, perl, etc. ?

Many thanks.
Philippe

show status is your friend:
show status like Connections
HTH,
Wolfram
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Number of connections to a database

2004-11-29 Thread Jon Stephens
Date: Mon, 29 Nov 2004 14:03:32 +0100
To: [EMAIL PROTECTED]
From: Philippe de Rochambeau [EMAIL PROTECTED]
Subject: Number of connections to a database
Message-Id: [EMAIL PROTECTED]
Hello,
is there any way to tell the number of simultaneous connections to a 
mysql database at a given time, using SQL or a scripting language such 
as php, perl, etc. ?

Many thanks.
Philippe
Perhaps this will help.
mysql SHOW STATUS LIKE 'threads_connected';
+---+---+
| Variable_name | Value |
+---+---+
| Threads_connected | 5 |
+---+---+
1 row in set (0.00 sec)
mysql SHOW STATUS LIKE '%connect%';
+--+---+
| Variable_name| Value |
+--+---+
| Aborted_connects | 2 |
| Connections  | 74|
| Max_used_connections | 27|
| Threads_connected| 5 |
+--+---+
4 rows in set (0.00 sec)
Connections: Total number of connections made since the MySQL server was 
last restarted.

Max_used_conections: Maximum number of simultaneous connections since 
the MySQL server was last restarted.

Threads_connected: Current number of connections.
--
Jon Stephens, Technical Writer
MySQL AB   www.mysql.com
Office: +61 (7) 3388 2228
Are you MySQL certified?  www.mysql.com/certification
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]