<div id="docs-body">
 <div class="chapter">
  <div class="titlepage">
   <div>
    <div>
     <h1 class="title">
      <a name="sys-schema">
      </a>
      Chapter 30 MySQL sys Schema
     </h1>
    </div>
   </div>
  </div>
  <div class="toc">
   <p>
    <b>
     Table of Contents
    </b>
   </p>
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="sys-schema-prerequisites.html">
       30.1 Prerequisites for Using the sys Schema
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="sys-schema-usage.html">
       30.2 Using the sys Schema
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="sys-schema-progress-reporting.html">
       30.3 sys Schema Progress Reporting
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="sys-schema-reference.html">
       30.4 sys Schema Object Reference
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="sys-schema-object-index.html">
         30.4.1 sys Schema Object Index
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="sys-schema-tables.html">
         30.4.2 sys Schema Tables and Triggers
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="sys-schema-views.html">
         30.4.3 sys Schema Views
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="sys-schema-procedures.html">
         30.4.4 sys Schema Stored Procedures
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="sys-schema-functions.html">
         30.4.5 sys Schema Stored Functions
        </a>
       </span>
      </dt>
     </dl>
    </dd>
   </dl>
  </div>
  <p>
   MySQL 8.4 includes the
   <a class="link" href="sys-schema.html" title="Chapter 30 MySQL sys Schema">
    <code class="literal">
     sys
    </code>
   </a>
   schema, a set of objects that
    helps DBAs and developers interpret data collected by the
    Performance Schema.
   <a class="link" href="sys-schema.html" title="Chapter 30 MySQL sys Schema">
    <code class="literal">
     sys
    </code>
   </a>
   schema objects
    can be used for typical tuning and diagnosis use cases. Objects in
    this schema include:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Views that summarize Performance Schema data into more easily
        understandable form.
     </p>
    </li>
    <li class="listitem">
     <p>
      Stored procedures that perform operations such as Performance
        Schema configuration and generating diagnostic reports.
     </p>
    </li>
    <li class="listitem">
     <p>
      Stored functions that query Performance Schema configuration and
        provide formatting services.
     </p>
    </li>
   </ul>
  </div>
  <p>
   For new installations, the
   <a class="link" href="sys-schema.html" title="Chapter 30 MySQL sys Schema">
    <code class="literal">
     sys
    </code>
   </a>
   schema
    is installed by default during data directory initialization if you
    use
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   with the
   <a class="link" href="server-options.html#option_mysqld_initialize">
    <code class="option">
     --initialize
    </code>
   </a>
   or
   <a class="link" href="server-options.html#option_mysqld_initialize-insecure">
    <code class="option">
     --initialize-insecure
    </code>
   </a>
   option. If this
    is not desired, you can drop the
   <a class="link" href="sys-schema.html" title="Chapter 30 MySQL sys Schema">
    <code class="literal">
     sys
    </code>
   </a>
   schema manually after initialization if it is unneeded.
  </p>
  <p>
   The MySQL upgrade procedure produces an error if a
   <a class="link" href="sys-schema.html" title="Chapter 30 MySQL sys Schema">
    <code class="literal">
     sys
    </code>
   </a>
   schema exists but has no
   <a class="link" href="sys-version.html" title="30.4.3.47 The version View">
    <code class="literal">
     version
    </code>
   </a>
   view, on the assumption that
    absence of this view indicates a user-created
   <code class="literal">
    sys
   </code>
   schema. To upgrade in this case, remove or rename the existing
   <a class="link" href="sys-schema.html" title="Chapter 30 MySQL sys Schema">
    <code class="literal">
     sys
    </code>
   </a>
   schema first.
  </p>
  <a class="indexterm" name="idm46045064095232">
  </a>
  <p>
   <a class="link" href="sys-schema.html" title="Chapter 30 MySQL sys Schema">
    <code class="literal">
     sys
    </code>
   </a>
   schema objects have a
   <code class="literal">
    DEFINER
   </code>
   of
   <code class="literal">
    'mysql.sys'@'localhost'
   </code>
   . Use of the dedicated
   <code class="literal">
    mysql.sys
   </code>
   account avoids problems that occur if a
    DBA renames or removes the
   <code class="literal">
    root
   </code>
   account.
  </p>
 </div>
 <br/>
</div>
