The key to accessing your data: MySQL Connectors and bindings for various languages
Being able to use an Open Source DBMS to manage your data is nice, but what good would it be if you can't easily access it from your applications? One key factor to the popularity of MySQL is probably its wide range of available language bindings, which started with support for C, PHP and Perl from early on.
I've tried to gather a list of languages and their respective MySQL drivers/modules below. It's by no means complete or exhaustive, but I think I covered quite a lot of popular as well as exotic programming languages.
There is a number of connectors which are actually developed by the Sun Database Group (aka MySQL) itself and that are ready to use:
- Connector/ODBC - Standardized database driver Windows, Linux, Mac OS X, and Unix platforms.
- Connector/J - Standardized database driver for Java platforms and development.
- Connector/Net - Standardized database driver for .NET platforms and development.
- Connector/MXJ - MBean for embedding the MySQL server in Java applications.
- MySQL native driver for PHP - mysqlnd - The MySQL native driver for PHP is an additional, alternative way to connect from PHP 6 to the MySQL Server 4.1 or newer.
- libmysql - The original implementation of the MySQL Client/Server protocol (in C). This library is the basis for a large number of client libraries for other languages.
In addition to the above, there are several other connectors developed by Sun/MySQL, which are still under development:
- MySQL Connector/OpenOffice.org - a driver that allows you to connect to MySQL with OpenOffice.org natively, without having to use JDBC/ODBC.
- PHP PDO mysqlnd - a PHP/PDO driver based on the mysqlnd driver
- Connector C++: a driver for C++ applications that uses an API similar to the JDBC 3.0 API.
But it's not only us who develop language bindings for the MySQL server. There is an abundance of drivers that are developed and maintained by the Community, independently from Sun/MySQL (but sometimes with support or guidance from MySQL engineers). The list below is not sorted in any particular order other than the sequence in how I found them over time:
- DBD::mysql - a MySQL driver for the DBI database abstraction layer of Perl scripting language. There used to be a a native driver named "Msql-Mysql-modules", but it does not seem to be maintained anymore.
- Net::MySQL - an implementation of the MySQL Client/Server Protocol in Perl (does not require the MySQL client library). There also is MySQL::Packet, a Perl module that can encode and decode the binary protocol.
- MySQLdb - a MySQL driver for the Python scripting language.
- mysqli, ext/mysqli - MySQL Improved Extension for PHP
- mysql, ext/mysql - MySQL Extension for PHP
- PDO_MYSQL - MySQL PDO driver for PHP
- MySQL/Ruby - the MySQL API module for Ruby, based on the libmysql C library.
- Ruby/MySQL - the MySQL Ruby API, implemented in Ruby.
- MySQL++ - a C++ wrapper for MySQL's C API. It is built around the same principles as the Standard C++ Library, to make dealing with the database as easy as dealing with STL containers.
- MySQL wrapped - another C++ wrapper for the MySQL C API.
- MySQLtcl - a simple API for accessing a MySQL database server from the Tcl programming language.
- MySQL-Cocoa - An Objective-C Cocoa API for MySQL (based on libmysql).
- Eiffel MySQL - an interface to the MySQL database server using the Eiffel programming language.
- Bryan O'Sullivan's pure Haskell MySQL bindings
- hsql-mysql - A MySQL driver for Haskell
- MySQL Driver for the programming language D
- MyDB module for the Kaya programming language (included in the distribution)
- MySQL bindings for the Objective Caml language
- MySQL bindings for GNU Ada
- The SPL programming language ships with a MySQL module included in the distribution
- Database bindings (incl. MySQL) for GNU Octave
- LuaSQL is a simple database interface for the Lua programming language
- erlang-mysql-driver - a revamped MySQL driver for Erlang
- Myscsh - a Scheme implementation of the MySQL protocol
I probably forgot some other drivers/bindings - if you have any more to add, please let me know!
And if you'd like to create your own implementation for your favourite language: the protocol is documented here and here. Jan's additional notes may also be helpful to get you started.