Book Image

Mastering MariaDB

By : Federico Razzoli
Book Image

Mastering MariaDB

By: Federico Razzoli

Overview of this book

Table of Contents (19 chapters)
Mastering MariaDB
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Monitoring connections


The SHOW PROCESSLIST statement returns information about the active connections. The PROCESSLIST table in the information_schema database contains additional complete information; we will discuss this. Also, the threads table in the performance_schema database includes the same information returned by SHOW PROCESSLIST, plus some extra columns. Normally, SHOW PROCESSLIST returns sufficient information and is less verbose. The PROCESSLIST table has the advantage that its contents can be used in a stored program.

The following example shows the contents of the PROCESSLIST table and the output of SHOW PROCESSLIST:

MariaDB [(none)]> SELECT * FROM information_schema.PROCESSLIST \G

*************************** 1. row ***************************

           ID: 5

         USER: root

         HOST: localhost

           DB: NULL

      COMMAND: Query

         TIME: 0

        STATE: Filling schema table

         INFO: SELECT * FROM information_schema.PROCESSLIST

  ...