
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What does 'show processlist' command do in MySQL?
The ‘SHOW processlist’ command can be used to display the running thread related to only your MySQL account. We can see almost all running threads if we have process privileges. It shows which threads are running.
The following is the query.
mysql> SHOW processlist;
Here is the output.
+----+-----------------+-----------------+------+---------+------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------------+------+---------+------+------------------------+------------------+ | 4 | event_scheduler | localhost | NULL | Daemon | 968 | Waiting on empty queue | NULL | | 9 | root | localhost:50255 | NULL | Query | 0 | starting | show processlist | +----+-----------------+-----------------+------+---------+------+------------------------+------------------+ 2 rows in set (0.00 sec)
If we change the database, then the output will be different, but there will always be the following two users: ‘event_scheduler’ and ‘root’.
Let us try the query again.
mysql> SHOW processlist;
The following is the output.
+----+-----------------+-----------------+----------+---------+------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------------+----------+---------+------+------------------------+------------------+ | 4 | event_scheduler | localhost | NULL | Daemon | 1148 | Waiting on empty queue | NULL | | 9 | root | localhost:50255 | business | Query | 0 | starting | show processlist | +----+-----------------+-----------------+----------+---------+------+------------------------+------------------+ 2 rows in set (0.00 sec)
- Related Articles
- How do I kill all the processes in MySQL “show processlist”?
- How to customize `show processlist` in MySQL?
- What information does SHOW TABLE DOES display in MySQL
- Show constraints on table command in MySQL?
- Combine SELECT & SHOW command results in MySQL?
- Show MySQL host via SQL Command?
- What does select @@identity do in MySQL?
- Does MongoDB getUsers() and SHOW command fulfil the same purpose?
- What does DELIMITER // do in a Trigger in MySQL?
- What does a “set+0” in a MySQL statement do?
- Does SELECT TOP command exist in MySQL to select limited number of records?
- Why does the update command in MySQL insist on using slanted single quotes?
- What is MySQL TRUNCATE command used for?
- What is MySQL DROP command used for?
- What is MySQL DELETE command used for?

Advertisements