• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

MySQL ‘show processlist’ statement

by admin

You can also get thread information from the INFORMATION_SCHEMA.PROCESSLIST table or the mysqladmin processlist command. If you do not have the PROCESS privilege, you can view only your own threads. That is, you can view only those threads associated with the MySQL account that you are using. If you do not use the FULL keyword, only the first 100 characters of each statement are shown in the Info field.

I am on a test MySQL database and currently, no process is running on it. On a busy database, you would see a longer list than shown below.

mysql show processlist statement

SHOW PROCESSLIST produces the following columns:

  • Id: Connection identifier
  • User: MySQL user who issued the statement
  • Host: Host name of the client issuing the statement
  • db: Default database selected; otherwise NULL
  • Command: Type of command that the thread is executing
  • Time: Time (in seconds) that the thread has been in its current state
  • State: Action, event, or state indicating what the thread is doing
  • Info: Statement that the thread is executing; otherwise NULL

The PROCESS privilege permits you to see all threads.

Using the SHOW FULL PROCESSLIST statement is very useful if you get a “too many connections” error message and want to determine which statements are executing. MySQL reserves one extra connection to be used by accounts that have the SUPER privilege. This ensures that even if the connection limit has been reached, an administrator can always connect and check the system, assuming that application users do not have the SUPER privilege.

mysql  show full processlist

Use the KILL statement to kill processes. If the process is running in a terminal that you can access, you can kill it with the “CTRL + C” keyboard combination, although this is less clean than using KILL.

Filed Under: mysql

Some more articles you might also be interested in …

  1. System Tuning for MySQL Server
  2. How to install and configure MySQL sys schema
  3. MySQL Shell: Using External Python Modules
  4. MySQL Grants – Setting User Permissions On Different Tables
  5. How to find the size of a MySQL database
  6. Understanding the REVOKE statement in MySQL
  7. How to Troubleshoot InnoDB Lock Issues
  8. Beginners Guide to Management of MySQL Cluster Log Files
  9. How to set the default character set in MySQL and how to propagate it in a master-master replication scenario
  10. MySQL Interview Questions : Multi-source Replication in MySQL Server

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright