Table of Contents [+/-]
CALL
StatementsMySQL 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 20.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
Library (libmysql
).
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
through the 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:
Using libmysql
offers
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
libmysql
.
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 20.1, “MySQL APIs and Interfaces”.
Table 20.1. MySQL APIs and Interfaces
Environment | API | Type | Notes |
---|---|---|---|
Ada | MySQL Bindings for GNU Ada | libmysql |
See MySQL Bindings for GNU Ada |
C | Connector/C | Replacement for libmysql
|
See Section 20.5, “MySQL Connector/C”. |
C++ | Connector/C++ | libmysql |
See MySQL Connector/C++. |
MySQL++ | libmysql |
See Section 20.11, “MySQL C++ API”. | |
MySQL wrapped | libmysql |
See MySQL wrapped. | |
Cocoa | MySQL-Cocoa | libmysql |
Compatible with the Objective-C Cocoa environment. See http://mysql-cocoa.sourceforge.net/ |
D | MySQL for D | libmysql |
See MySQL for D. |
Eiffel | Eiffel MySQL | libmysql |
See Section 20.15, “MySQL Eiffel Wrapper”. |
Erlang | erlang-mysql-driver |
libmysql |
See
erlang-mysql-driver .
|
Haskell | Haskell MySQL Bindings | Native Driver | See Brian O'Sullivan's pure Haskell MySQL bindings. |
hsql-mysql |
libmysql |
See MySQL driver for Haskell . | |
Java/JDBC | Connector/J | Native Driver | See Section 20.3, “MySQL Connector/J”. |
Kaya | MyDB | libmysql |
See MyDB. |
Lua | LuaSQL | libmysql |
See LuaSQL. |
.NET/Mono | Connector/NET | Native Driver | See Section 20.2, “MySQL Connector/NET”. |
Objective Caml | MySQL Bindings for OBjective Caml | libmysql |
See MySQL Bindings for Objective Caml. |
Octave | Database bindings for GNU Octave | libmysql |
See Database bindings for GNU Octave. |
ODBC | Connector/ODBC | libmysql |
See Section 20.1, “MySQL Connector/ODBC”. |
OpenOffice | MySQL Connector/OpenOffice.org | libmysql |
Direct connectivity, without using JDBC/ODBC. See Section 20.6, “MySQL Connector/OpenOffice.org”. |
Perl |
DBI /DBD::mysql
|
libmysql |
See Section 20.10, “MySQL Perl API”. |
Net::MySQL |
Native Driver | See
Net::MySQL
at CPAN |
|
PHP |
mysql , ext/mysql interface
(deprecated) |
libmysql |
See Section 20.9.1, “MySQL”. |
mysqli , ext/mysqli interface |
libmysql |
See Section 20.9.2, “MySQL Improved Extension (Mysqli )”. |
|
PDO_MYSQL |
libmysql |
See Section 20.9.4, “MySQL Functions (PDO_MYSQL)”. | |
PDO mysqlnd | Native Driver | See PHP PDO
mysqlnd .
|
|
Python | MySQLdb | libmysql |
See Section 20.12, “MySQL Python API”. |
Ruby | MySQL/Ruby | libmysql |
Uses libmysql . See
Section 20.13.1, “The MySQL/Ruby API”. |
Ruby/MySQL | Native Driver | See Section 20.13.2, “The Ruby/MySQL API”. | |
Scheme | Myscsh |
libmysql |
See
Myscsh . |
SPL | sql_mysql |
libmysql |
See
sql_mysql
for SPL. |
Tcl | MySQLtcl | libmysql |
See Section 20.14, “MySQL Tcl API”. |
Table 20.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.1+, 5.0, 5.1, 5.4 |
User Comments
Add your own comment.