<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="debugging-server">
      </a>
      7.9.1 Debugging a MySQL Server
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="compiling-for-debugging.html">
       7.9.1.1 Compiling MySQL for Debugging
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="making-trace-files.html">
       7.9.1.2 Creating Trace Files
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="making-windows-dumps.html">
       7.9.1.3 Using WER with PDB to create a Windows crashdump
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="using-gdb-on-mysqld.html">
       7.9.1.4 Debugging mysqld under gdb
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="using-stack-trace.html">
       7.9.1.5 Using a Stack Trace
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="using-log-files.html">
       7.9.1.6 Using Server Logs to Find Causes of Errors in mysqld
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="reproducible-test-case.html">
       7.9.1.7 Making a Test Case If You Experience Table Corruption
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045253858032">
  </a>
  <a class="indexterm" name="idm46045253856576">
  </a>
  <a class="indexterm" name="idm46045253855088">
  </a>
  <p>
   If you are using some functionality that is very new in MySQL, you
      can try to run
   <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_skip-new">
    <code class="option">
     --skip-new
    </code>
   </a>
   option (which disables
      all new, potentially unsafe functionality). See
   <a class="xref" href="crashing.html" title="B.3.3.3 What to Do If MySQL Keeps Crashing">
    Section B.3.3.3, “What to Do If MySQL Keeps Crashing”
   </a>
   .
  </p>
  <p>
   If
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   does not want to start, verify that
      you have no
   <code class="filename">
    my.cnf
   </code>
   files that interfere with
      your setup! You can check your
   <code class="filename">
    my.cnf
   </code>
   arguments with
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld --print-defaults
     </strong>
    </span>
   </a>
   and
      avoid using them by starting with
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld --no-defaults
      ...
     </strong>
    </span>
   </a>
   .
  </p>
  <p>
   If
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   starts to eat up CPU or memory or if
      it
   <span class="quote">
    “
    <span class="quote">
     hangs,
    </span>
    ”
   </span>
   you can use
   <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
    <span class="command">
     <strong>
      mysqladmin
      processlist status
     </strong>
    </span>
   </a>
   to find out if someone is executing a
      query that takes a long time. It may be a good idea to run
   <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
    <span class="command">
     <strong>
      mysqladmin -i10 processlist status
     </strong>
    </span>
   </a>
   in some
      window if you are experiencing performance problems or problems
      when new clients cannot connect.
  </p>
  <p>
   The command
   <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
    <span class="command">
     <strong>
      mysqladmin debug
     </strong>
    </span>
   </a>
   dumps some
      information about locks in use, used memory and query usage to the
      MySQL log file. This may help solve some problems. This command
      also provides some useful information even if you have not
      compiled MySQL for debugging!
  </p>
  <p>
   If the problem is that some tables are getting slower and slower
      you should try to optimize the table with
   <a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
    <code class="literal">
     OPTIMIZE TABLE
    </code>
   </a>
   or
   <a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
    <span class="command">
     <strong>
      myisamchk
     </strong>
    </span>
   </a>
   . See
   <a class="xref" href="server-administration.html" title="Chapter 7 MySQL Server Administration">
    Chapter 7,
    <i>
     MySQL Server Administration
    </i>
   </a>
   . You should also check the
      slow queries with
   <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
    <code class="literal">
     EXPLAIN
    </code>
   </a>
   .
  </p>
  <p>
   You should also read the OS-specific section in this manual for
      problems that may be unique to your environment. See
   <a class="xref" href="general-installation-issues.html" title="2.1 General Installation Guidance">
    Section 2.1, “General Installation Guidance”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
