The world's most popular open source database
Table of Contents [+/-]
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 Java (JDBC), ODBC, Perl, Python, PHP, Ruby, and native C and embedded MySQL instances.
Connector version numbers do not correlate with MySQL Server version numbers. See also Table 21.2, “MySQL Connector Versions and MySQL Server Versions”.
A number of connectors are developed by MySQL:
Connector/ODBC provides driver support for connecting to a MySQL server using the Open Database Connectivity (ODBC) API. Support is available for ODBC connectivity from Windows, Unix and Mac OS X platforms.
Connector/NET enables developers to create .NET applications that use data stored in a MySQL database. Connector/NET implement a fully functional ADO.NET interface and provides support for use with ADO.NET aware tools. Applications that want to use Connector/NET can be written in any of the supported .NET languages.
The MySQL Visual Studio Plugin works with Connector/NET and Visual Studio 2005. The plugin is a MySQL DDEX Provider, which means that you can use the schema and data manipulation tools within Visual Studio to create and edit objects within a MySQL database.
Connector/J provides driver support for connecting to MySQL from a Java application using the standard Java Database Connectivity (JDBC) API.
Connector/MXJ is a tool that enables easy deployment and management of MySQL server and database through your Java application.
Connector/C++ is a tool that enables easy deployment and management of MySQL server and database through your C++ application.
Connector/C is a stand-alone replacement for the MySQL Client
Connector/OpenOffice.org is a tool that enables OpenOffice.org applications to connect to MySQL server.
There are two direct access methods for using MySQL natively within a C application:
The C API provides low-level access to the MySQL protocol
libmysql 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 APIs also detailed in this section. MySQL Connector/C can now also be
used for this purpose.
libmysqld is an embedded MySQL server library
that enables you to embed an instance of the MySQL server into
your C applications.
If you need to access MySQL from a C application, or build an interface to MySQL for a language not supported by the Connectors or APIs in this chapter, the C API is where you would start. A number of programmers utilities are available to help with the process, and also covered in this section.
The remaining APIs provide an interface to MySQL from specific application langauges. These solutions are not developed or supported by MySQL. Basic information on their usage and abilities is provided here for reference purposes only.
All the language APIs are developed using one of two methods, using
libmysql or by building a native
driver. The two solutions offer different benefits:
complete compatibility with MySQL as it uses the same libraries
as the MySQL client applications. However, the feature set is
limited to the implementation and interfaces exposed through
libmysql and the performance may be lower as
data is copied between the native langiage, and the MySQL API
components. MySQL Connector/C is a possible alternative to using
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 to build and deploy, as you do not need a copy of the MySQL client libraries to build the native driver components.
A list of many of the libraries and interfaces available for MySQL are shown in the table. See Table 21.1, “MySQL APIs and Interfaces”.
Table 21.1. MySQL APIs and Interfaces
|Ada||MySQL Bindings for GNU Ada||
||See MySQL Bindings for GNU Ada|
||See Section 21.6, “MySQL Connector/C”.|
||See Section 21.5, “MySQL Connector/C++”.|
||See Section 21.12, “MySQL C++ API”.|
||See MySQL wrapped.|
||Compatible with the Objective-C Cocoa environment. See http://mysql-cocoa.sourceforge.net/|
|D||MySQL for D||
||See MySQL for D.|
||See Section 21.16, “MySQL Eiffel Wrapper”.|
|Haskell||Haskell MySQL Bindings||Native Driver||See Brian O'Sullivan's pure Haskell MySQL bindings.|
||See MySQL driver for Haskell .|
|Java/JDBC||Connector/J||Native Driver||See Section 21.3, “MySQL Connector/J”.|
|.NET/Mono||Connector/NET||Native Driver||See Section 21.2, “MySQL Connector/NET”.|
|Objective Caml||MySQL Bindings for OBjective Caml||
||See MySQL Bindings for Objective Caml.|
|Octave||Database bindings for GNU Octave||
||See Database bindings for GNU Octave.|
||See Section 21.1, “MySQL Connector/ODBC”.|
||Direct connectivity, without using JDBC/ODBC. See Section 21.7, “MySQL Connector/OpenOffice.org”.|
||See Section 21.11, “MySQL Perl API”.|
||See Section 21.10.1, “MySQL”.|
||See Section 21.10.2, “MySQL Improved Extension (
||See Section 21.10.4, “MySQL Functions (PDO_MYSQL)”.|
|PDO mysqlnd||Native Driver||See PHP PDO
||See Section 21.13, “MySQL Python API”.|
|Ruby/MySQL||Native Driver||See Section 21.14.2, “The Ruby/MySQL API”.|
||See Section 21.15, “MySQL Tcl API”.|
Table 21.2. MySQL Connector Versions and MySQL Server Versions
|Connector||Connector version||MySQL Server version|
|Connector/C++||1.0.5 GA||5.1, 5.4|
|Connector/OpenOffice.org||1.0 GA||5.0, 5.1, 5.4|
|Connector/J||5.1.8||4.1, 5.0, 5.1, 5.4|
|Connector/NET||1.0 (No longer supported)||4.0, 5.0|
|Connector/NET||5.2||5.0, 5.1, 5.4|
|Connector/NET||6.0||5.0, 5.1, 5.4|
|Connector/NET||6.1||5.0, 5.1, 5.4|
|Connector/ODBC||3.51 (Unicode not supported)||4.1, 5.0, 5.1, 5.4|
|Connector/ODBC||5.1||4.1, 5.0, 5.1, 5.4|