• 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. How to Troubleshoot InnoDB Lock Issues
  2. Understanding the REVOKE statement in MySQL
  3. System Tuning for MySQL Server
  4. MySQL : Stored Procedure For Rotating the Audit Log
  5. How to reset MySQL database root password
  6. How to Migrate from Oracle to MySQL
  7. MySQL Cluster requirements to avoid Single Point of Failure
  8. How To Skip a Transaction on MySQL replication slave When GTIDs Are Enabled
  9. Configuring mysqld to log slow queries
  10. Understanding MySQL Privileges

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright