<docbook><section><title>MySQL2ODBC</title><title> MySQL-to-ODBC Gateway</title> <ulink url="MySQL">MySQL</ulink>-to-ODBC Gateway
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Introduction</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> What Is It?</bridgehead>
<para><ulink url="MySQL2ODBC">MySQL2ODBC</ulink> is a library for intercepting <ulink url="MySQL">MySQL</ulink> API calls and redirecting them via ODBC.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Why?</bridgehead>
<para>Historically the open-source community has produced many useful applications tied to the LAMP stack (Linux, Apache, <ulink url="MySQL">MySQL</ulink> and PHP) or similar variants.
 Often, however, the reliance on <ulink url="MySQL">MySQL</ulink> as the database layer of choice has been baked-in with little scope for substituting another RDBMS.</para>
<para>On the other hand, ODBC has long provided flexible choice of backend RDBMS - by talking ODBC, an application can switch between <ulink url="PostgreSQL">PostgreSQL</ulink>, <ulink url="MySQL">MySQL</ulink>, Oracle, SQL Server, <ulink url="OpenLink">OpenLink</ulink> Virtuoso and many more at will.</para>
<para><ulink url="MySQL2ODBC">MySQL2ODBC</ulink> is one way to break free of vendor lock-in and restore database-independence via ODBC :)</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Benefits</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>Cost-Effectiveness - <ulink url="MySQL2ODBC">MySQL2ODBC</ulink> saves having to rewrite the whole database access layer in a potentially large application </listitem>
<listitem>Database-Independence: Freedom of Choice</listitem>
</itemizedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> HOWTO</bridgehead>
<para><ulink url="MySQL2ODBC">MySQL2ODBC</ulink> provides a substitute libmysqlclient library.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Method</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h4"> Building <ulink url="MySQL2ODBC">MySQL2ODBC</ulink></bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>Download mysql2odbc-0.99.2.tar.gz </listitem>
<listitem>unpack it somewhere in your usual source directory <span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:verbatimtar xvpfz mysql2odbc-0.99.2.tar.gz</span> </listitem>
<listitem>check the options to configure by running ./configure --help - you can choose which ODBC Driver Manager to work with, either unixODBC or iODBC </listitem>
<listitem><span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:verbatim./configure --with-iodbc=/usr/local/iodbc --prefix=/usr/local/mysql2odbc</span> </listitem>
<listitem><span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:verbatimmake</span> </listitem>
<listitem><span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:verbatimsudo make install</span></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h4"> Deploying <ulink url="MySQL2ODBC">MySQL2ODBC</ulink></bridgehead>
<para>Your application needs to be told to use the <ulink url="MySQL2ODBC">MySQL2ODBC</ulink> implementation of libmysqlclient in preference to the existing version.
 To do this, either</para>
<span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:verbatimexport LD_LIBRARY_PATH=/usr/local/mysql2odbc/lib</span><para>or</para>
<span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:verbatimexport LD_PRELOAD=/usr/local/mysql2odbc/lib/libmysqlclient.so</span><para>and restart the application.
 You might want to create a shell-script wrapper to preserve this.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Download &amp; License</bridgehead>
<para>The source can be downloaded from github as a zip archive: <ulink url="https://github.com/openlink/mysql2odbc/archive/refs/heads/develop.zip">MySQL2ODBC source zip</ulink>.</para>
<para>Alternatively you can clone the repository:</para>
<span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:verbatimgit clone https://github.com/openlink/mysql2odbc.git</span><para>The project is licensed under the terms of the GNU <ulink url="https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html">Library General Public License (LGPL) v2</ulink>.</para>
<para>Patches are welcomed - please either send us a merge request via github or email the <ulink url="OpenLink">OpenLink</ulink> iODBC source archive manager at <ulink url="mailto:iodbc@openlinksw.com">iodbc@openlinksw.com</ulink>, including documentation.
 Thank you for your contributions :) </para>
</section></docbook>