What SQL command returns the number of active connections to the database?
What SQL command returns the number of active connections to the database?
Another option to view the connections is:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
SHOW VARIABLES;
To list all bank statuses, type:
SHOW STATUS;
And to get execution events, including the very one below:
SHOW STATUS where Variable_name='Com_show_status';
To get connection status only:
SHOW STATUS where Variable_name like '%connect%';
What is the SQL statement to show the maximum number of active connections ( possible ) in MySql?
select @@max_connections;
@@ max_connections is a global variable.
Now if you want to know how many connections are active it would look like this:
SHOW STATUS WHERE 'variable_name' = 'Threads_connected';
I'll leave a bonus on the answer, it has the command show processlist
which is a much used command too.