<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="innodb-troubleshooting">
      </a>
      17.20 InnoDB Troubleshooting
     </h2>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="error-creating-innodb.html">
       17.20.1 Troubleshooting InnoDB I/O Problems
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-troubleshooting-recovery.html">
       17.20.2 Troubleshooting Recovery Failures
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="forcing-innodb-recovery.html">
       17.20.3 Forcing InnoDB Recovery
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-troubleshooting-datadict.html">
       17.20.4 Troubleshooting InnoDB Data Dictionary Operations
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="innodb-error-handling.html">
       17.20.5 InnoDB Error Handling
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045149070336">
  </a>
  <p>
   The following general guidelines apply to troubleshooting
   <code class="literal">
    InnoDB
   </code>
   problems:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      When an operation fails or you suspect a bug, look at the MySQL
        server error log (see
      <a class="xref" href="error-log.html" title="7.4.2 The Error Log">
       Section 7.4.2, “The Error Log”
      </a>
      ).
      <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html" target="_top">
       Server Error Message Reference
      </a>
      provides
        troubleshooting information for some of the common
      <code class="literal">
       InnoDB
      </code>
      -specific errors that you may
        encounter.
     </p>
    </li>
    <li class="listitem">
     <p>
      If the failure is related to a
      <a class="link" href="glossary.html#glos_deadlock" title="deadlock">
       deadlock
      </a>
      , run with the
      <a class="link" href="innodb-parameters.html#sysvar_innodb_print_all_deadlocks">
       <code class="literal">
        innodb_print_all_deadlocks
       </code>
      </a>
      option enabled so that details about each deadlock are printed
        to the MySQL server error log. For information about deadlocks,
        see
      <a class="xref" href="innodb-deadlocks.html" title="17.7.5 Deadlocks in InnoDB">
       Section 17.7.5, “Deadlocks in InnoDB”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      If the issue is related to the
      <code class="literal">
       InnoDB
      </code>
      data
        dictionary, see
      <a class="xref" href="innodb-troubleshooting-datadict.html" title="17.20.4 Troubleshooting InnoDB Data Dictionary Operations">
       Section 17.20.4, “Troubleshooting InnoDB Data Dictionary Operations”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      When troubleshooting, it is usually best to run the MySQL server
        from the command prompt, rather than through
      <a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
       <span class="command">
        <strong>
         mysqld_safe
        </strong>
       </span>
      </a>
      or as a Windows service. You can
        then see what
      <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
       <span class="command">
        <strong>
         mysqld
        </strong>
       </span>
      </a>
      prints to the console,
        and so have a better grasp of what is going on. On Windows,
        start
      <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_console">
       <code class="option">
        --console
       </code>
      </a>
      option to direct the
        output to the console window.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045149051824">
      </a>
      <a class="indexterm" name="idm46045149050336">
      </a>
      Enable the
      <code class="literal">
       InnoDB
      </code>
      Monitors to obtain
        information about a problem (see
      <a class="xref" href="innodb-monitors.html" title="17.17 InnoDB Monitors">
       Section 17.17, “InnoDB Monitors”
      </a>
      ). If the problem is
        performance-related, or your server appears to be hung, you
        should enable the standard Monitor to print information about
        the internal state of
      <code class="literal">
       InnoDB
      </code>
      . If the problem
        is with locks, enable the Lock Monitor. If the problem is with
        table creation, tablespaces, or data dictionary operations,
        refer to the
      <a class="link" href="innodb-information-schema-system-tables.html" title="17.15.3 InnoDB INFORMATION_SCHEMA Schema Object Tables">
       InnoDB
        Information Schema system tables
      </a>
      to examine contents of
        the
      <code class="literal">
       InnoDB
      </code>
      internal data dictionary.
     </p>
     <p>
      <code class="literal">
       InnoDB
      </code>
      temporarily enables standard
      <code class="literal">
       InnoDB
      </code>
      Monitor output under the following
        conditions:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         A long semaphore wait
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          InnoDB
         </code>
         cannot find free blocks in the
            buffer pool
        </p>
       </li>
       <li class="listitem">
        <p>
         Over 67% of the buffer pool is occupied by lock heaps or the
            adaptive hash index
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      If you suspect that a table is corrupt, run
      <a class="link" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
       <code class="literal">
        CHECK TABLE
       </code>
      </a>
      on that table.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
