- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How to list down all the running queries in MySQL?
To list running queries, we need to use the ‘show processlist’ command.
The following is the query.
mysql> SHOW processlist;
The following is the output of the above query.
+----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | 4 | event_scheduler | localhost | NULL | Daemon | 13785 | Waiting on empty queue | NULL | | 9 | root | localhost:63587 | business | Query | 0 | starting | show processlist | +----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ 2 rows in set (0.00 sec)
Let us display the result horizontally with the help of SHOW command.
mysql> SHOW FULL PROCESSLIST\G;
The following is the output of the above query.
*************************** 1. row *************************** Id: 4 User: event_scheduler Host: localhost db: NULL Command: Daemon Time: 17385 State: Waiting on empty queue Info: NULL *************************** 2. row *************************** Id: 9 User: root Host: localhost:63587 db: business Command: Query Time: 0 State: starting Info: SHOW FULL PROCESSLIST 2 rows in set (0.00 sec)
- Related Articles
- List down all the Tables in a MySQL Database
- How to list down all the files alphabetically using Python?
- How to list down all the plug-in installed in your browser?
- Running OLAP queries in SAP HANA
- How to list down all the cookies by name using JavaScript?
- How to display all items in the list in the drop down in Selenium?
- How to list down all the files available in a directory using C#?
- How to list down all the available commands and aliases on Linux?
- How to list all triggers in a MySQL database?
- How to execute multiple select queries in MySQL ?
- How to get all options in a drop-down list by Selenium WebDriver using C#?
- How to list running screen sessions on Linux?
- How to list all variables initialized by SET operator in MySQL?
- How to calculate running count of occurrence in list in Excel?
- How do I list all the columns in a MySQL table?

Advertisements