<div id="docs-body">
 <div class="chapter">
  <div class="titlepage">
   <div>
    <div>
     <h1 class="title">
      <a name="connectors-apis">
      </a>
      Chapter 31 Connectors and APIs
     </h1>
    </div>
   </div>
  </div>
  <div class="toc">
   <p>
    <b>
     Table of Contents
    </b>
   </p>
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="connector-cpp-info.html">
       31.1 MySQL Connector/C++
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="connector-j-info.html">
       31.2 MySQL Connector/J
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="connector-net-info.html">
       31.3 MySQL Connector/NET
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="connector-odbc-info.html">
       31.4 MySQL Connector/ODBC
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="connector-python-info.html">
       31.5 MySQL Connector/Python
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="connector-nodejs-info.html">
       31.6 MySQL Connector/Node.js
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="c-api-info.html">
       31.7 MySQL C API
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="apis-php-info.html">
       31.8 MySQL PHP API
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="apis-perl.html">
       31.9 MySQL Perl API
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="apis-python.html">
       31.10 MySQL Python API
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="apis-ruby.html">
       31.11 MySQL Ruby APIs
      </a>
     </span>
    </dt>
    <dd>
     <dl>
      <dt>
       <span class="section">
        <a href="apis-ruby-mysqlruby.html">
         31.11.1 The MySQL/Ruby API
        </a>
       </span>
      </dt>
      <dt>
       <span class="section">
        <a href="apis-ruby-rubymysql.html">
         31.11.2 The Ruby/MySQL API
        </a>
       </span>
      </dt>
     </dl>
    </dd>
    <dt>
     <span class="section">
      <a href="apis-tcl.html">
       31.12 MySQL Tcl API
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="apis-eiffel.html">
       31.13 MySQL Eiffel Wrapper
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045060619472">
  </a>
  <a class="indexterm" name="idm46045060618400">
  </a>
  <a class="indexterm" name="idm46045060617328">
  </a>
  <a class="indexterm" name="idm46045060616256">
  </a>
  <a class="indexterm" name="idm46045060615184">
  </a>
  <a class="indexterm" name="idm46045060614112">
  </a>
  <a class="indexterm" name="idm46045060613040">
  </a>
  <a class="indexterm" name="idm46045060611968">
  </a>
  <a class="indexterm" name="idm46045060610896">
  </a>
  <a class="indexterm" name="idm46045060609824">
  </a>
  <a class="indexterm" name="idm46045060608752">
  </a>
  <a class="indexterm" name="idm46045060607680">
  </a>
  <a class="indexterm" name="idm46045060606608">
  </a>
  <a class="indexterm" name="idm46045060605120">
  </a>
  <p>
   MySQL Connectors provide connectivity to the MySQL server for client
    programs. APIs provide low-level access to MySQL resources using
    either the classic MySQL protocol or X Protocol. Both Connectors and the
    APIs enable you to connect and execute MySQL statements from another
    language or environment, including ODBC, Java (JDBC), C++, Python,
    Node.js, PHP, Perl, Ruby, and C.
  </p>
  <h2>
   <a name="idm46045060602832">
   </a>
   MySQL Connectors
  </h2>
  <p>
   Oracle develops a number of connectors:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="ulink" href="/doc/connector-cpp/9.1/en/" target="_top">
       Connector/C++
      </a>
      enables C++ applications to connect to MySQL.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="ulink" href="/doc/connector-j/en/" target="_top">
       Connector/J
      </a>
      provides driver
        support for connecting to MySQL from Java applications using the
        standard Java Database Connectivity (JDBC) API.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="ulink" href="/doc/connector-net/en/" target="_top">
       Connector/NET
      </a>
      enables developers
        to create .NET applications that connect to MySQL. Connector/NET
        implements a fully functional ADO.NET interface and provides
        support for use with ADO.NET aware tools. Applications that use
        Connector/NET can be written in any supported .NET language.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="ulink" href="/doc/connector-odbc/en/" target="_top">
       Connector/ODBC
      </a>
      provides
        driver support for connecting to MySQL using the Open Database
        Connectivity (ODBC) API. Support is available for ODBC
        connectivity from Windows, Unix, and macOS platforms.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="ulink" href="/doc/connector-python/en/" target="_top">
       Connector/Python
      </a>
      provides driver support for connecting to MySQL from Python
        applications using an API that is compliant with the
      <a class="ulink" href="http://www.python.org/dev/peps/pep-0249/" target="_blank">
       Python DB
        API version 2.0
      </a>
      . No additional Python modules or MySQL
        client libraries are required.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       Connector/Node.js
      </code>
      provides an asynchronous
        API for connecting to MySQL from Node.js applications using
        X Protocol. Connector/Node.js supports managing database
        sessions and schemas, working with MySQL Document Store
        collections and using raw SQL statements.
     </p>
    </li>
   </ul>
  </div>
  <h2>
   <a name="idm46045060590336">
   </a>
   The MySQL C API
  </h2>
  <p>
   For direct access to using MySQL natively within a C application,
    the
   <a class="ulink" href="/doc/c-api/8.4/en/" target="_top">
    C API
   </a>
   provides low-level access to
    the MySQL client/server protocol through the
   <code class="literal">
    libmysqlclient
   </code>
   client library. This is the
    primary method used to connect to an instance of the MySQL server,
    and is used both by MySQL command-line clients and many of the MySQL
    Connectors and third-party APIs detailed here.
  </p>
  <p>
   <code class="literal">
    libmysqlclient
   </code>
   is included in MySQL distributions
    distributions.
  </p>
  <p>
   See also
   <a class="ulink" href="/doc/c-api/8.4/en/c-api-implementations.html" target="_top">
    MySQL C API Implementations
   </a>
   .
  </p>
  <p>
   To access MySQL from a C application, or to build an interface to
    MySQL for a language not supported by the Connectors or APIs in this
    chapter, the
   <a class="ulink" href="/doc/c-api/8.4/en/" target="_top">
    C API
   </a>
   is where to start. A
    number of programmer's utilities are available to help with the
    process; see
   <a class="xref" href="programs-development.html" title="6.7 Program Development Utilities">
    Section 6.7, “Program Development Utilities”
   </a>
   .
  </p>
  <h2>
   <a name="idm46045060582960">
   </a>
   Third-Party MySQL APIs
  </h2>
  <p>
   The remaining APIs described in this chapter provide an interface to
    MySQL from specific application languages. These third-party
    solutions are not developed or supported by Oracle. Basic
    information on their usage and abilities is provided here for
    reference purposes only.
  </p>
  <p>
   All the third-party language APIs are developed using one of two
    methods, using
   <code class="literal">
    libmysqlclient
   </code>
   or by implementing
    a
   <span class="firstterm">
    native driver
   </span>
   . The two
    solutions offer different benefits:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Using
      <span class="emphasis">
       <em>
        <code class="literal">
         libmysqlclient
        </code>
       </em>
      </span>
      offers complete compatibility with MySQL because it uses the
        same libraries as the MySQL client applications. However, the
        feature set is limited to the implementation and interfaces
        exposed through
      <code class="literal">
       libmysqlclient
      </code>
      and the
        performance may be lower as data is copied between the native
        language, and the MySQL API components.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="emphasis">
       <em>
        Native drivers
       </em>
      </span>
      are an implementation of the
        MySQL network protocol entirely within the host language or
        environment. Native drivers are fast, as there is less copying
        of data between components, and they can offer advanced
        functionality not available through the standard MySQL API.
        Native drivers are also easier for end users to build and deploy
        because no copy of the MySQL client libraries is needed to build
        the native driver components.
     </p>
    </li>
   </ul>
  </div>
  <p>
   <a class="xref" href="connectors-apis.html#connectors-apis-summary" title="Table 31.1 MySQL APIs and Interfaces">
    Table 31.1, “MySQL APIs and Interfaces”
   </a>
   lists many of the
    libraries and interfaces available for MySQL.
  </p>
  <div class="table">
   <a name="connectors-apis-summary">
   </a>
   <p class="title">
    <b>
     Table 31.1 MySQL APIs and Interfaces
    </b>
   </p>
   <div class="table-contents">
    <table summary="Summary of MySQL APIs and interfaces showing the environment, API, type, and related notes.">
     <colgroup>
      <col style="width: 10%"/>
      <col style="width: 35%"/>
      <col style="width: 15%"/>
      <col style="width: 40%"/>
     </colgroup>
     <thead>
      <tr>
       <th scope="col">
        Environment
       </th>
       <th scope="col">
        API
       </th>
       <th scope="col">
        Type
       </th>
       <th scope="col">
        Notes
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <th scope="row">
        Ada
       </th>
       <td>
        GNU Ada MySQL Bindings
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://gnade.sourceforge.net/" target="_blank">
         MySQL Bindings for GNU
        Ada
        </a>
       </td>
      </tr>
      <tr>
       <th scope="row">
        C
       </th>
       <td>
        C API
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="/doc/c-api/8.4/en/" target="_top">
         MySQL 8.4 C API Developer Guide
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        C++
       </th>
       <td>
        Connector/C++
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="/doc/connector-cpp/9.1/en/" target="_top">
         MySQL Connector/C++ 9.1 Developer Guide
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        MySQL++
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://tangentsoft.net/mysql++/doc/" target="_blank">
         MySQL++
        website
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        MySQL wrapped
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://www.alhem.net/project/mysql/" target="_blank">
         MySQL
        wrapped
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Cocoa
       </th>
       <td>
        MySQL-Cocoa
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        Compatible with the Objective-C Cocoa environment. See
        <a class="ulink" href="http://mysql-cocoa.sourceforge.net/" target="_blank">
         http://mysql-cocoa.sourceforge.net/
        </a>
       </td>
      </tr>
      <tr>
       <th scope="row">
        D
       </th>
       <td>
        MySQL for D
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://www.steinmole.de/d/" target="_blank">
         MySQL for D
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Eiffel
       </th>
       <td>
        Eiffel MySQL
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="xref" href="apis-eiffel.html" title="31.13 MySQL Eiffel Wrapper">
         Section 31.13, “MySQL Eiffel Wrapper”
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Erlang
       </th>
       <td>
        <code class="literal">
         erlang-mysql-driver
        </code>
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://code.google.com/p/erlang-mysql-driver/" target="_blank">
         <code class="literal">
          erlang-mysql-driver
         </code>
         .
        </a>
       </td>
      </tr>
      <tr>
       <th scope="row">
        Haskell
       </th>
       <td>
        Haskell MySQL Bindings
       </td>
       <td>
        Native Driver
       </td>
       <td>
        See
        <a class="ulink" href="http://www.serpentine.com/blog/software/mysql/" target="_blank">
         Brian
        O'Sullivan's pure Haskell MySQL bindings
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        <code class="literal">
         hsql-mysql
        </code>
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsql-mysql-1.7" target="_blank">
         MySQL
        driver for Haskell
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Java/JDBC
       </th>
       <td>
        Connector/J
       </td>
       <td>
        Native Driver
       </td>
       <td>
        See
        <a class="ulink" href="/doc/connector-j/en/" target="_top">
         MySQL Connector/J Developer Guide
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Kaya
       </th>
       <td>
        MyDB
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://kayalang.org/library/latest/MyDB" target="_blank">
         MyDB
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Lua
       </th>
       <td>
        LuaSQL
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://keplerproject.github.io/luasql/doc/us/" target="_blank">
         LuaSQL
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        .NET/Mono
       </th>
       <td>
        Connector/NET
       </td>
       <td>
        Native Driver
       </td>
       <td>
        See
        <a class="ulink" href="/doc/connector-net/en/" target="_top">
         MySQL Connector/NET Developer Guide
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Objective Caml
       </th>
       <td>
        OBjective Caml MySQL Bindings
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://raevnos.pennmush.org/code/ocaml-mysql/" target="_blank">
         MySQL
        Bindings for Objective Caml
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Octave
       </th>
       <td>
        Database bindings for GNU Octave
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://octave.sourceforge.net/database/index.html" target="_blank">
         Database
        bindings for GNU Octave
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        ODBC
       </th>
       <td>
        Connector/ODBC
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="/doc/connector-odbc/en/" target="_top">
         MySQL Connector/ODBC Developer Guide
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Perl
       </th>
       <td>
        <code class="literal">
         DBI
        </code>
        /
        <code class="literal">
         DBD::mysql
        </code>
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="xref" href="apis-perl.html" title="31.9 MySQL Perl API">
         Section 31.9, “MySQL Perl API”
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        <code class="literal">
         Net::MySQL
        </code>
       </td>
       <td>
        Native Driver
       </td>
       <td>
        See
        <a class="ulink" href="http://search.cpan.org/dist/Net-MySQL/MySQL.pm" target="_blank">
         <code class="literal">
          Net::MySQL
         </code>
        </a>
        at CPAN
       </td>
      </tr>
      <tr>
       <th scope="row">
        PHP
       </th>
       <td>
        <code class="literal">
         mysql
        </code>
        ,
        <code class="literal">
         ext/mysql
        </code>
        interface
        (deprecated)
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="/doc/apis-php/en/" target="_top">
         MySQL and PHP
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        <code class="literal">
         mysqli
        </code>
        ,
        <code class="literal">
         ext/mysqli
        </code>
        interface
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="/doc/apis-php/en/" target="_top">
         MySQL and PHP
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        <code class="literal">
         PDO_MYSQL
        </code>
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="/doc/apis-php/en/" target="_top">
         MySQL and PHP
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        PDO mysqlnd
       </td>
       <td>
        Native Driver
       </td>
       <td>
       </td>
      </tr>
      <tr>
       <th scope="row">
        Python
       </th>
       <td>
        Connector/Python
       </td>
       <td>
        Native Driver
       </td>
       <td>
        See
        <a class="ulink" href="/doc/connector-python/en/" target="_top">
         MySQL Connector/Python Developer Guide
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Python
       </th>
       <td>
        Connector/Python C Extension
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="/doc/connector-python/en/" target="_top">
         MySQL Connector/Python Developer Guide
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
       </th>
       <td>
        MySQLdb
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="xref" href="apis-python.html" title="31.10 MySQL Python API">
         Section 31.10, “MySQL Python API”
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Ruby
       </th>
       <td>
        mysql2
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        Uses
        <code class="literal">
         libmysqlclient
        </code>
        . See
        <a class="xref" href="apis-ruby.html" title="31.11 MySQL Ruby APIs">
         Section 31.11, “MySQL Ruby APIs”
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Scheme
       </th>
       <td>
        <code class="literal">
         Myscsh
        </code>
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="https://github.com/aehrisch/myscsh" target="_blank">
         <code class="literal">
          Myscsh
         </code>
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        SPL
       </th>
       <td>
        <code class="literal">
         sql_mysql
        </code>
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="ulink" href="http://www.clifford.at/spl/spldoc/sql_mysql.html" target="_blank">
         <code class="literal">
          sql_mysql
         </code>
         for SPL
        </a>
        .
       </td>
      </tr>
      <tr>
       <th scope="row">
        Tcl
       </th>
       <td>
        MySQLtcl
       </td>
       <td>
        <code class="literal">
         libmysqlclient
        </code>
       </td>
       <td>
        See
        <a class="xref" href="apis-tcl.html" title="31.12 MySQL Tcl API">
         Section 31.12, “MySQL Tcl API”
        </a>
        .
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <div class="table-contents">
    <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
     <thead>
      <tr>
       <th scope="col" style="width: 99.1406px;">
        Environment
       </th>
       <th scope="col" style="width: 241.047px;">
        API
       </th>
       <th scope="col" style="width: 120.766px;">
        Type
       </th>
       <th scope="col" style="width: 277.047px;">
        Notes
       </th>
      </tr>
     </thead>
    </table>
   </div>
  </div>
  <br class="table-break"/>
 </div>
 <br/>
</div>
