<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="show-processlist">
      </a>
      15.7.7.31 SHOW PROCESSLIST Statement
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045169918416">
  </a>
  <a class="indexterm" name="idm46045169917376">
  </a>
  <a class="indexterm" name="idm46045169916304">
  </a>
  <a class="indexterm" name="idm46045169915216">
  </a>
  <a class="indexterm" name="idm46045169913728">
  </a>
  <a class="indexterm" name="idm46045169912240">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa77614371"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SHOW</span> <span class="token punctuation">[</span><span class="token keyword">FULL</span><span class="token punctuation">]</span> <span class="token keyword">PROCESSLIST</span></code></pre>
  </div>
  <div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Important
   </div>
   <p>
    The INFORMATION SCHEMA implementation of
    <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
     <code class="literal">
      SHOW PROCESSLIST
     </code>
    </a>
    is deprecated
          and subject to removal in a future MySQL release. It is
          recommended to use the Performance Schema implementation of
    <code class="literal">
     SHOW PROCESSLIST
    </code>
    instead.
   </p>
  </div>
  <p>
   The MySQL process list indicates the operations currently being
        performed by the set of threads executing within the server. The
   <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
    <code class="literal">
     SHOW PROCESSLIST
    </code>
   </a>
   statement is one
        source of process information. For a comparison of this
        statement with other sources, see
   <a class="xref" href="processlist-access.html#processlist-sources" title="Sources of Process Information">
    Sources of Process Information
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    An alternative implementation for
    <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
     <code class="literal">
      SHOW
          PROCESSLIST
     </code>
    </a>
    is available based on the Performance
          Schema
    <a class="link" href="performance-schema-processlist-table.html" title="29.12.22.7 The processlist Table">
     <code class="literal">
      processlist
     </code>
    </a>
    table, which,
          unlike the default
    <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
     <code class="literal">
      SHOW
          PROCESSLIST
     </code>
    </a>
    implementation, does not require a mutex
          and has better performance characteristics. For details, see
    <a class="xref" href="performance-schema-processlist-table.html" title="29.12.22.7 The processlist Table">
     Section 29.12.22.7, “The processlist Table”
    </a>
    .
   </p>
  </div>
  <p>
   If you have the
   <a class="link" href="privileges-provided.html#priv_process">
    <code class="literal">
     PROCESS
    </code>
   </a>
   privilege, you can see all threads, even those belonging to
        other users. Otherwise (without the
   <a class="link" href="privileges-provided.html#priv_process">
    <code class="literal">
     PROCESS
    </code>
   </a>
   privilege), nonanonymous
        users have access to information about their own threads but not
        threads for other users, and anonymous users have no access to
        thread information.
  </p>
  <p>
   Without the
   <code class="literal">
    FULL
   </code>
   keyword,
   <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
    <code class="literal">
     SHOW PROCESSLIST
    </code>
   </a>
   displays only
        the first 100 characters of each statement in the
   <code class="literal">
    Info
   </code>
   field.
  </p>
  <p>
   The
   <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
    <code class="literal">
     SHOW PROCESSLIST
    </code>
   </a>
   statement is
        very useful if you get the
   <span class="quote">
    “
    <span class="quote">
     too many connections
    </span>
    ”
   </span>
   error message and want to find out what is going on. MySQL
        reserves one extra connection to be used by accounts that have
        the
   <a class="link" href="privileges-provided.html#priv_connection-admin">
    <code class="literal">
     CONNECTION_ADMIN
    </code>
   </a>
   privilege
        (or the deprecated
   <a class="link" href="privileges-provided.html#priv_super">
    <code class="literal">
     SUPER
    </code>
   </a>
   privilege), to ensure that administrators should always be able
        to connect and check the system (assuming that you are not
        giving this privilege to all your users).
  </p>
  <p>
   Threads can be killed with the
   <a class="link" href="kill.html" title="15.7.8.4 KILL Statement">
    <code class="literal">
     KILL
    </code>
   </a>
   statement. See
   <a class="xref" href="kill.html" title="15.7.8.4 KILL Statement">
    Section 15.7.8.4, “KILL Statement”
   </a>
   .
  </p>
  <p>
   Example of
   <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
    <code class="literal">
     SHOW PROCESSLIST
    </code>
   </a>
   output:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa74913005"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">FULL</span> <span class="token keyword">PROCESSLIST</span>\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     Id<span class="token punctuation">:</span> 1
   User<span class="token punctuation">:</span> system user
   Host<span class="token punctuation">:</span>
     db<span class="token punctuation">:</span> NULL
Command<span class="token punctuation">:</span> Connect
   Time<span class="token punctuation">:</span> 1030455
  State<span class="token punctuation">:</span> Waiting for source to send event
   Info<span class="token punctuation">:</span> NULL
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 2. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     Id<span class="token punctuation">:</span> 2
   User<span class="token punctuation">:</span> system user
   Host<span class="token punctuation">:</span>
     db<span class="token punctuation">:</span> NULL
Command<span class="token punctuation">:</span> Connect
   Time<span class="token punctuation">:</span> 1004
  State<span class="token punctuation">:</span> Has read all relay log; waiting for the replica
         I/O thread to update it
   Info<span class="token punctuation">:</span> NULL
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 3. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     Id<span class="token punctuation">:</span> 3112
   User<span class="token punctuation">:</span> replikator
   Host<span class="token punctuation">:</span> artemis<span class="token punctuation">:</span>2204
     db<span class="token punctuation">:</span> NULL
Command<span class="token punctuation">:</span> Binlog Dump
   Time<span class="token punctuation">:</span> 2144
  State<span class="token punctuation">:</span> Has sent all binlog to replica; waiting for binlog to be updated
   Info<span class="token punctuation">:</span> NULL
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 4. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     Id<span class="token punctuation">:</span> 3113
   User<span class="token punctuation">:</span> replikator
   Host<span class="token punctuation">:</span> iconnect2<span class="token punctuation">:</span>45781
     db<span class="token punctuation">:</span> NULL
Command<span class="token punctuation">:</span> Binlog Dump
   Time<span class="token punctuation">:</span> 2086
  State<span class="token punctuation">:</span> Has sent all binlog to replica; waiting for binlog to be updated
   Info<span class="token punctuation">:</span> NULL
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 5. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     Id<span class="token punctuation">:</span> 3123
   User<span class="token punctuation">:</span> stefan
   Host<span class="token punctuation">:</span> localhost
     db<span class="token punctuation">:</span> apollon
Command<span class="token punctuation">:</span> Query
   Time<span class="token punctuation">:</span> 0
  State<span class="token punctuation">:</span> NULL
   Info<span class="token punctuation">:</span> SHOW FULL PROCESSLIST</span></code></pre>
  </div>
  <p>
   <a class="link" href="show-processlist.html" title="15.7.7.31 SHOW PROCESSLIST Statement">
    <code class="literal">
     SHOW PROCESSLIST
    </code>
   </a>
   output has these
        columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a name="processlist_id">
      </a>
      <code class="literal">
       Id
      </code>
     </p>
     <p>
      The connection identifier. This is the same value displayed
            in the
      <code class="literal">
       ID
      </code>
      column of the
      <code class="literal">
       INFORMATION_SCHEMA
      </code>
      <a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
       <code class="literal">
        PROCESSLIST
       </code>
      </a>
      table, displayed in
            the
      <code class="literal">
       PROCESSLIST_ID
      </code>
      column of the
            Performance Schema
      <a class="link" href="performance-schema-threads-table.html" title="29.12.22.8 The threads Table">
       <code class="literal">
        threads
       </code>
      </a>
      table, and returned by the
      <a class="link" href="information-functions.html#function_connection-id">
       <code class="literal">
        CONNECTION_ID()
       </code>
      </a>
      function
            within the thread.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="processlist_user">
      </a>
      <code class="literal">
       User
      </code>
     </p>
     <p>
      The MySQL user who issued the statement. A value of
      <code class="literal">
       system user
      </code>
      refers to a nonclient thread
            spawned by the server to handle tasks internally, for
            example, a delayed-row handler thread or an I/O (receiver)
            or SQL (applier) thread used on replica hosts. For
      <code class="literal">
       system user
      </code>
      , there is no host specified
            in the
      <code class="literal">
       Host
      </code>
      column.
      <code class="literal">
       unauthenticated user
      </code>
      refers to a thread
            that has become associated with a client connection but for
            which authentication of the client user has not yet
            occurred.
      <code class="literal">
       event_scheduler
      </code>
      refers to the
            thread that monitors scheduled events (see
      <a class="xref" href="event-scheduler.html" title="27.4 Using the Event Scheduler">
       Section 27.4, “Using the Event Scheduler”
      </a>
      ).
     </p>
     <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
      <div class="admon-title">
       Note
      </div>
      <p>
       A
       <code class="literal">
        User
       </code>
       value of
       <code class="literal">
        system
              user
       </code>
       is distinct from the
       <a class="link" href="privileges-provided.html#priv_system-user">
        <code class="literal">
         SYSTEM_USER
        </code>
       </a>
       privilege. The
              former designates internal threads. The latter
              distinguishes the system user and regular user account
              categories (see
       <a class="xref" href="account-categories.html" title="8.2.11 Account Categories">
        Section 8.2.11, “Account Categories”
       </a>
       ).
      </p>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a name="processlist_host">
      </a>
      <code class="literal">
       Host
      </code>
     </p>
     <p>
      The host name of the client issuing the statement (except
            for
      <code class="literal">
       system user
      </code>
      , for which there is no
            host). The host name for TCP/IP connections is reported in
      <code class="literal">
       <em class="replaceable">
        <code>
         host_name
        </code>
       </em>
       :
       <em class="replaceable">
        <code>
         client_port
        </code>
       </em>
      </code>
      format to make it easier to determine which client is doing
            what.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="processlist_db">
      </a>
      <code class="literal">
       db
      </code>
     </p>
     <p>
      The default database for the thread, or
      <code class="literal">
       NULL
      </code>
      if none has been selected.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="processlist_command">
      </a>
      <code class="literal">
       Command
      </code>
     </p>
     <p>
      The type of command the thread is executing on behalf of the
            client, or
      <code class="literal">
       Sleep
      </code>
      if the session is idle.
            For descriptions of thread commands, see
      <a class="xref" href="thread-information.html" title="10.14 Examining Server Thread (Process) Information">
       Section 10.14, “Examining Server Thread (Process) Information”
      </a>
      . The value of this
            column corresponds to the
      <code class="literal">
       COM_
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
      </code>
      commands of the client/server protocol and
      <code class="literal">
       Com_
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
      </code>
      status
            variables. See
      <a class="xref" href="server-status-variables.html" title="7.1.10 Server Status Variables">
       Section 7.1.10, “Server Status Variables”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="processlist_time">
      </a>
      <code class="literal">
       Time
      </code>
     </p>
     <p>
      The time in seconds that the thread has been in its current
            state. For a replica SQL thread, the value is the number of
            seconds between the timestamp of the last replicated event
            and the real time of the replica host. See
      <a class="xref" href="replication-threads.html" title="19.2.3 Replication Threads">
       Section 19.2.3, “Replication Threads”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="processlist_state">
      </a>
      <code class="literal">
       State
      </code>
     </p>
     <p>
      An action, event, or state that indicates what the thread is
            doing. For descriptions of
      <code class="literal">
       State
      </code>
      values,
            see
      <a class="xref" href="thread-information.html" title="10.14 Examining Server Thread (Process) Information">
       Section 10.14, “Examining Server Thread (Process) Information”
      </a>
      .
     </p>
     <p>
      Most states correspond to very quick operations. If a thread
            stays in a given state for many seconds, there might be a
            problem that needs to be investigated.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a name="processlist_info">
      </a>
      <code class="literal">
       Info
      </code>
     </p>
     <p>
      The statement the thread is executing, or
      <code class="literal">
       NULL
      </code>
      if it is executing no statement. The
            statement might be the one sent to the server, or an
            innermost statement if the statement executes other
            statements. For example, if a
      <code class="literal">
       CALL
      </code>
      statement executes a stored procedure that is executing a
      <a class="link" href="select.html" title="15.2.13 SELECT Statement">
       <code class="literal">
        SELECT
       </code>
      </a>
      statement, the
      <code class="literal">
       Info
      </code>
      value shows the
      <a class="link" href="select.html" title="15.2.13 SELECT Statement">
       <code class="literal">
        SELECT
       </code>
      </a>
      statement.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
