MySQL?-to-ODBC Gateway

Introduction

What Is It?

MySQL2ODBC is a library for intercepting MySQL? API calls and redirecting them via ODBC.

Why?

Historically the open-source community has produced many useful applications tied to the LAMP stack (Linux, Apache, MySQL? and PHP) or similar variants. Often, however, the reliance on MySQL? as the database layer of choice has been baked-in with little scope for substituting another RDBMS.

On the other hand, ODBC has long provided flexible choice of backend RDBMS - by talking ODBC, an application can switch between PostgreSQL?, MySQL?, Oracle, SQL Server, OpenLink? Virtuoso and many more at will.

MySQL2ODBC is one way to break free of vendor lock-in and restore database-independence via ODBC :)

Benefits

HOWTO

MySQL2ODBC provides a substitute libmysqlclient library.

Method

Building MySQL2ODBC

Deploying MySQL2ODBC

Your application needs to be told to use the MySQL2ODBC implementation of libmysqlclient in preference to the existing version. To do this, either

export LD_LIBRARY_PATH=/usr/local/mysql2odbc/lib

or

export LD_PRELOAD=/usr/local/mysql2odbc/lib/libmysqlclient.so

and restart the application. You might want to create a shell-script wrapper to preserve this.

Download & License

The source can be downloaded from github as a zip archive: MySQL2ODBC source zip.

Alternatively you can clone the repository:

git clone https://github.com/openlink/mysql2odbc.git

The project is licensed under the terms of the GNU Library General Public License (LGPL) v2.

Patches are welcomed - please either send us a merge request via github or email the OpenLink? iODBC source archive manager at iodbc@openlinksw.com, including documentation. Thank you for your contributions :)