Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.4Mb
PDF (A4) - 31.4Mb
PDF (RPM) - 30.5Mb
HTML Download (TGZ) - 7.6Mb
HTML Download (Zip) - 7.7Mb
HTML Download (RPM) - 6.6Mb
Man Pages (TGZ) - 185.5Kb
Man Pages (Zip) - 299.3Kb
Info (Gzip) - 2.9Mb
Info (Zip) - 2.9Mb
Excerpts from this Manual

MySQL 5.6 Reference Manual  /  Connectors and APIs

Chapter 23 Connectors and APIs

Table of Contents     [+/-]

23.1 MySQL Connector/ODBC
23.2 MySQL Connector/Net
23.3 MySQL Connector/J
23.4 MySQL Connector/C++
23.5 MySQL Connector/C
23.6 MySQL Connector/Python
23.7 libmysqld, the Embedded MySQL Server Library     [+/-]
23.8 MySQL C API     [+/-]
23.10 MySQL Perl API
23.11 MySQL Python API
23.12 MySQL Ruby APIs     [+/-]
23.13 MySQL Tcl API
23.14 MySQL Eiffel Wrapper

MySQL Connectors provide connectivity to the MySQL server for client programs. APIs provide low-level access to the MySQL protocol and MySQL resources. Both Connectors and the APIs enable you to connect and execute MySQL statements from another language or environment, including ODBC, Java (JDBC), Perl, Python, PHP, Ruby, and native C and embedded MySQL instances.


Connector version numbers do not correlate with MySQL Server version numbers. See Table 23.2, “MySQL Connector Versions and MySQL Server Versions”.

MySQL Connectors

Oracle develops a number of connectors:

  • Connector/ODBC provides driver support for connecting to MySQL using the Open Database Connectivity (ODBC) API. Support is available for ODBC connectivity from Windows, Unix, and OS X platforms.

  • Connector/Net 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.

    MySQL for Visual Studio works with Connector/Net and Microsoft Visual Studio 2012, 2013, 2015, and 2017. MySQL for Visual Studio provides access to MySQL objects and data from Visual Studio. As a Visual Studio package, it integrates directly into Server Explorer providing the ability to create new connections and work with MySQL database objects.

  • Connector/J provides driver support for connecting to MySQL from Java applications using the standard Java Database Connectivity (JDBC) API.

  • Connector/Python provides driver support for connecting to MySQL from Python applications using an API that is compliant with the Python DB API version 2.0. No additional Python modules or MySQL client libraries are required.

  • Connector/C++ enables C++ applications to connect to MySQL.

  • Connector/C is a standalone replacement for the MySQL Client Library (libmysqlclient), to be used for C applications.


For direct access to using MySQL natively within a C application, there are two methods:

  • The C API provides low-level access to the MySQL client/server protocol through the libmysqlclient 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.

    libmysqlclient is included in MySQL distributions and in Connector/C distributions.

  • libmysqld is an embedded MySQL server library that enables you to embed an instance of the MySQL server into your C applications.

    libmysqld is included in MySQL distributions, but not in Connector/C distributions.

See also Section 23.8.1, “MySQL C API Implementations”.

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 C API is where to start. A number of programmer's utilities are available to help with the process; see Section 4.7, “MySQL Program Development Utilities”.

Third-Party MySQL APIs

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.

All the third-party language APIs are developed using one of two methods, using libmysqlclient or by implementing a native driver. The two solutions offer different benefits:

  • Using libmysqlclient 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 libmysqlclient and the performance may be lower as data is copied between the native language, and the MySQL API components.

  • Native drivers 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.

Table 23.1, “MySQL APIs and Interfaces” lists many of the libraries and interfaces available for MySQL. Table 23.2, “MySQL Connector Versions and MySQL Server Versions” shows which MySQL Server versions each connector supports.

Table 23.1 MySQL APIs and Interfaces

AdaGNU Ada MySQL BindingslibmysqlclientSee MySQL Bindings for GNU Ada
CC APIlibmysqlclientSee Section 23.8, “MySQL C API”.
CConnector/CReplacement for libmysqlclientSee MySQL Connector/C Developer Guide.
C++Connector/C++libmysqlclientSee MySQL Connector/C++ Developer Guide.
 MySQL++libmysqlclientSee MySQL++ Web site.
 MySQL wrappedlibmysqlclientSee MySQL wrapped.
CocoaMySQL-CocoalibmysqlclientCompatible with the Objective-C Cocoa environment. See
DMySQL for DlibmysqlclientSee MySQL for D.
EiffelEiffel MySQLlibmysqlclientSee Section 23.14, “MySQL Eiffel Wrapper”.
Erlangerlang-mysql-driverlibmysqlclientSee erlang-mysql-driver.
HaskellHaskell MySQL BindingsNative DriverSee Brian O'Sullivan's pure Haskell MySQL bindings.
 hsql-mysqllibmysqlclientSee MySQL driver for Haskell .
Java/JDBCConnector/JNative DriverSee MySQL Connector/J 5.1 Developer Guide.
KayaMyDBlibmysqlclientSee MyDB.
LuaLuaSQLlibmysqlclientSee LuaSQL.
.NET/MonoConnector/NetNative DriverSee MySQL Connector/Net Developer Guide.
Objective CamlOBjective Caml MySQL BindingslibmysqlclientSee MySQL Bindings for Objective Caml.
OctaveDatabase bindings for GNU OctavelibmysqlclientSee Database bindings for GNU Octave.
ODBCConnector/ODBClibmysqlclientSee MySQL Connector/ODBC Developer Guide.
PerlDBI/DBD::mysqllibmysqlclientSee Section 23.10, “MySQL Perl API”.
 Net::MySQLNative DriverSee Net::MySQL at CPAN
PHPmysql, ext/mysql interface (deprecated)libmysqlclientSee Original MySQL API.
 mysqli, ext/mysqli interfacelibmysqlclientSee MySQL Improved Extension.
 PDO_MYSQLlibmysqlclientSee MySQL Functions (PDO_MYSQL).
 PDO mysqlndNative Driver 
PythonConnector/PythonNative DriverSee MySQL Connector/Python Developer Guide.
PythonConnector/Python C ExtensionlibmysqlclientSee MySQL Connector/Python Developer Guide.
 MySQLdblibmysqlclientSee Section 23.11, “MySQL Python API”.
RubyMySQL/RubylibmysqlclientUses libmysqlclient. See Section 23.12.1, “The MySQL/Ruby API”.
 Ruby/MySQLNative DriverSee Section 23.12.2, “The Ruby/MySQL API”.
SchemeMyscshlibmysqlclientSee Myscsh.
SPLsql_mysqllibmysqlclientSee sql_mysql for SPL.
TclMySQLtcllibmysqlclientSee Section 23.13, “MySQL Tcl API”.

Table 23.2 MySQL Connector Versions and MySQL Server Versions

ConnectorConnector versionMySQL Server version
Connector/C6.1.0 GA5.6, 5.5, 5.1, 5.0, 4.1
Connector/C++1.0.5 GA5.6, 5.5, 5.1
Connector/J5.1.85.6, 5.5, 5.1, 5.0, 4.1
Connector/Net6.9.9 GA5.7, 5.6, 5.5, 5.1, 5.0
Connector/Net6.8.8 GA5.7, 5.6, 5.5, 5.1, 5.0
Connector/ODBC5.15.6, 5.5, 5.1, 5.0, 4.1.1+
Connector/ODBC3.51 (Unicode not supported)5.6, 5.5, 5.1, 5.0, 4.1
Connector/Python2.05.7, 5.6, 5.5
Connector/Python1.25.7, 5.6, 5.5

User Comments
Sign Up Login You must be logged in to post a comment.