- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MySQL status in terms of active or total connections?
The active or total connection can be known with the help of threads_connected variable. The variable tells about the number of currently open connections.
The query is as follows −
mysql> show status where `variable_name` = 'Threads_connected';
Here is the output.
+-------------------+-------+ | Variable_name | Value | +-------------------+-------+ | Threads_connected | 1 | +-------------------+-------+ 1 row in set (0.06 sec)
We can check the same with the help of show command. The query is as follows −
mysql> show processlist;
Here is the output.
+----+-----------------+-----------------+----------+---------+--------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------------+----------+---------+--------+------------------------+------------------+ | 4 | event_scheduler | localhost | NULL | Daemon | 349012 | Waiting on empty queue | NULL | | 11 | root | localhost:54746 | business | Query | 1 | starting | show processlist | +----+-----------------+-----------------+----------+---------+--------+------------------------+------------------+ 2 rows in set (0.31 sec)
Advertisements