<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="communication-errors">
      </a>
      B.3.2.9 Communication Errors and Aborted Connections
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045054303776">
  </a>
  <a class="indexterm" name="idm46045054302736">
  </a>
  <a class="indexterm" name="idm46045054301664">
  </a>
  <p>
   If connection problems occur such as communication errors or
          aborted connections, use these sources of information to
          diagnose problems:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The 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>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The general query log. See
      <a class="xref" href="query-log.html" title="7.4.3 The General Query Log">
       Section 7.4.3, “The General Query Log”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <code class="literal">
       Aborted_
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
      </code>
      and
      <code class="literal">
       Connection_errors_
       <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>
      The host cache, which is accessible using the Performance
              Schema
      <a class="link" href="performance-schema-host-cache-table.html" title="29.12.22.3 The host_cache Table">
       <code class="literal">
        host_cache
       </code>
      </a>
      table. See
      <a class="xref" href="host-cache.html" title="7.1.12.3 DNS Lookups and the Host Cache">
       Section 7.1.12.3, “DNS Lookups and the Host Cache”
      </a>
      , and
      <a class="xref" href="performance-schema-host-cache-table.html" title="29.12.22.3 The host_cache Table">
       Section 29.12.22.3, “The host_cache Table”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   If the
   <a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
    <code class="literal">
     log_error_verbosity
    </code>
   </a>
   system variable is set to 3, you might find messages like this
          in your error log:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-none"><div class="docs-select-all right" id="sa91273300"><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-none">[Note] Aborted connection 854 to db: 'employees' user: 'josh'</code></pre>
  </div>
  <p>
   If a client is unable even to connect, the server increments
          the
   <a class="link" href="server-status-variables.html#statvar_Aborted_connects">
    <code class="literal">
     Aborted_connects
    </code>
   </a>
   status
          variable. Unsuccessful connection attempts can occur for the
          following reasons:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      A client attempts to access a database but has no
              privileges for it.
     </p>
    </li>
    <li class="listitem">
     <p>
      A client uses an incorrect password.
     </p>
    </li>
    <li class="listitem">
     <p>
      A connection packet does not contain the right
              information.
     </p>
    </li>
    <li class="listitem">
     <p>
      It takes more than
      <a class="link" href="server-system-variables.html#sysvar_connect_timeout">
       <code class="literal">
        connect_timeout
       </code>
      </a>
      seconds
              to obtain a connect packet. See
      <a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
       Section 7.1.8, “Server System Variables”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   If these kinds of things happen, it might indicate that
          someone is trying to break into your server! If the general
          query log is enabled, messages for these types of problems are
          logged to it.
  </p>
  <p>
   If a client successfully connects but later disconnects
          improperly or is terminated, the server increments the
   <a class="link" href="server-status-variables.html#statvar_Aborted_clients">
    <code class="literal">
     Aborted_clients
    </code>
   </a>
   status
          variable, and logs an
   <span class="errortext">
    Aborted
          connection
   </span>
   message to the error log. The cause can
          be any of the following:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The client program did not call
      <a class="ulink" href="/doc/c-api/8.4/en/mysql-close.html" target="_top">
       <code class="literal">
        mysql_close()
       </code>
      </a>
      before
              exiting.
     </p>
    </li>
    <li class="listitem">
     <p>
      The client had been sleeping more than
      <a class="link" href="server-system-variables.html#sysvar_wait_timeout">
       <code class="literal">
        wait_timeout
       </code>
      </a>
      or
      <a class="link" href="server-system-variables.html#sysvar_interactive_timeout">
       <code class="literal">
        interactive_timeout
       </code>
      </a>
      seconds without issuing any requests to the server. See
      <a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
       Section 7.1.8, “Server System Variables”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      The client program ended abruptly in the middle of a data
              transfer.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Other reasons for problems with aborted connections or aborted
          clients:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The
      <a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
       <code class="literal">
        max_allowed_packet
       </code>
      </a>
      variable value is too small or queries require more memory
              than you have allocated for
      <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
       <span class="command">
        <strong>
         mysqld
        </strong>
       </span>
      </a>
      . See
      <a class="xref" href="packet-too-large.html" title="B.3.2.8 Packet Too Large">
       Section B.3.2.8, “Packet Too Large”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Use of Ethernet protocol with Linux, both half and full
              duplex. Some Linux Ethernet drivers have this bug. You
              should test for this bug by transferring a huge file using
              FTP between the client and server machines. If a transfer
              goes in burst-pause-burst-pause mode, you are experiencing
              a Linux duplex syndrome. Switch the duplex mode for both
              your network card and hub/switch to either full duplex or
              to half duplex and test the results to determine the best
              setting.
     </p>
    </li>
    <li class="listitem">
     <p>
      A problem with the thread library that causes interrupts
              on reads.
     </p>
    </li>
    <li class="listitem">
     <p>
      Badly configured TCP/IP.
     </p>
    </li>
    <li class="listitem">
     <p>
      Faulty Ethernets, hubs, switches, cables, and so forth.
              This can be diagnosed properly only by replacing hardware.
     </p>
    </li>
   </ul>
  </div>
  <p>
   See also
   <a class="xref" href="gone-away.html" title="B.3.2.7 MySQL server has gone away">
    Section B.3.2.7, “MySQL server has gone away”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
