<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="perl-support-problems">
      </a>
      2.10.3 Problems Using the Perl DBI/DBD Interface
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045326458752">
  </a>
  <a class="indexterm" name="idm46045326457296">
  </a>
  <p>
   If Perl reports that it cannot find the
   <code class="filename">
    ../mysql/mysql.so
   </code>
   module, the problem is
      probably that Perl cannot locate the
   <code class="filename">
    libmysqlclient.so
   </code>
   shared library. You should
      be able to fix this problem by one of the following methods:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Copy
      <code class="filename">
       libmysqlclient.so
      </code>
      to the directory
          where your other shared libraries are located (probably
      <code class="filename">
       /usr/lib
      </code>
      or
      <code class="filename">
       /lib
      </code>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      Modify the
      <code class="option">
       -L
      </code>
      options used to compile
      <code class="literal">
       DBD::mysql
      </code>
      to reflect the actual location
          of
      <code class="filename">
       libmysqlclient.so
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      On Linux, you can add the path name of the directory where
      <code class="filename">
       libmysqlclient.so
      </code>
      is located to the
      <code class="filename">
       /etc/ld.so.conf
      </code>
      file.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045326444944">
      </a>
      <a class="indexterm" name="idm46045326443856">
      </a>
      <a class="indexterm" name="idm46045326442368">
      </a>
      <a class="indexterm" name="idm46045326441280">
      </a>
      Add the path name of the directory where
      <code class="filename">
       libmysqlclient.so
      </code>
      is located to the
      <code class="literal">
       LD_RUN_PATH
      </code>
      environment variable. Some
          systems use
      <code class="literal">
       LD_LIBRARY_PATH
      </code>
      instead.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Note that you may also need to modify the
   <code class="option">
    -L
   </code>
   options if there are other libraries that the linker fails to
      find. For example, if the linker cannot find
   <code class="literal">
    libc
   </code>
   because it is in
   <code class="filename">
    /lib
   </code>
   and the link command specifies
   <code class="option">
    -L/usr/lib
   </code>
   , change
      the
   <code class="option">
    -L
   </code>
   option to
   <code class="option">
    -L/lib
   </code>
   or add
   <code class="option">
    -L/lib
   </code>
   to the existing link command.
  </p>
  <p>
   If you get the following errors from
   <code class="literal">
    DBD::mysql
   </code>
   , you are probably using
   <span class="command">
    <strong>
     gcc
    </strong>
   </span>
   (or using an old binary compiled with
   <span class="command">
    <strong>
     gcc
    </strong>
   </span>
   ):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-none"><div class="docs-select-all right" id="sa28043904"><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">/usr/bin/perl: can't resolve symbol '__moddi3'
/usr/bin/perl: can't resolve symbol '__divdi3'</code></pre>
  </div>
  <p>
   Add
   <code class="option">
    -L/usr/lib/gcc-lib/... -lgcc
   </code>
   to the link
      command when the
   <code class="filename">
    mysql.so
   </code>
   library gets built
      (check the output from
   <span class="command">
    <strong>
     make
    </strong>
   </span>
   for
   <code class="filename">
    mysql.so
   </code>
   when you compile the Perl client).
      The
   <code class="option">
    -L
   </code>
   option should specify the path name of the
      directory where
   <code class="filename">
    libgcc.a
   </code>
   is located on your
      system.
  </p>
  <p>
   Another cause of this problem may be that Perl and MySQL are not
      both compiled with
   <span class="command">
    <strong>
     gcc
    </strong>
   </span>
   . In this case, you can
      solve the mismatch by compiling both with
   <span class="command">
    <strong>
     gcc
    </strong>
   </span>
   .
  </p>
 </div>
 <br/>
</div>
