mxODBC™ provides an easy to use, high-performance, reliable and robust Python interface to ODBC compatible databases such as MS SQL Server, Oracle Database, IBM DB2, Informix and Netezza, SAP Sybase ASE and Sybase Anywhere, Teradata, MySQL, MariaDB, PostgreSQL, SAP MaxDB and many more. It is an extension to our open-source eGenix.com mx Base Distribution.
ODBC refers to Open Database Connectivity and is the industry standard API for connecting applications to databases.
In order to facilitate setting up ODBC connectivity, operating systems typically provide ODBC Managers which help set up the ODBC drivers and manage the binding of the applications against these drivers. On Windows the ODBC Data Source Manager is built into the system. On Mac OS X, the iODBC ODBC Manager is part of the OS, with an optional ODBC manager GUI available as separate download. On Unix platforms, you can choose one of the ODBC managers unixODBC, iODBC or DataDirect, which provide the same ODBC functionality on most Unix systems.
Databases usually ship with ODBC drivers for Windows, so it's
easy to get Python connected to a database on Windows. If you are working on Linux and Mac
OS X, you can typically download drivers from the database vendor. If you have trouble finding a
database driver for your platform, try the ODBC vendor list on SQLSummit.com (web archive copy), or have a look at our mxODBC Connect product:
If you are looking for a platform independent remote database connectivity solution for Python, you may be interested in our mxODBC Connect product, which eliminates the need to have an ODBC driver for the client side of the application. It specializes on remote database connections such as the ones you typically find in web-applications, e.g. where multiple Linux servers need to communicate with a company database running on a Windows server.
The eGenix mxODBC distribution includes the mxODBC package needed to connect Python to an ODBC manager. However, it does not include an ODBC manager or any ODBC drivers. You have to have these installed in order to be able to use mxODBC with Python.
On Windows, the situation is very simple: most databases come with ODBC drivers and register them with the Windows ODBC manager that's part of every Windows system.
Please consult the ODBC driver documentation for details on how to setup ODBC data sources. The mxODBC User Manual also includes a section on this topic and some helpful hints in case you run into problems.
On Unix, you will have to install one of the popular ODBC managers iODBC or unixODBC and then register the ODBC drivers for your database with these ODBC managers.
Linux systems usually come with at least one of these ODBC managers pre-installed. Please see the mxODBC User Manual for setup instructions.
It is also possible to use the DataDirect ODBC manager on Linux systems, if needed, or recommended by your database vendor.
On Mac OS X, you can use the system system ODBC manager (which is a version of the popular iODBC manager).
Please see the mxODBC User Manual for setup instructions.
On other systems, you can use our mxODBC Connect product to connect to your databases from Python. Unlike mxODBC, the mxODBC Connect product
does not need ODBC drivers on the client side. Only the server needs an
ODBC driver installed and this is typically run directly on the
database server, giving you much better performance and more stability
for your applications.
The eGenix.com mxODBC Distribution is a commercial product and made available under the terms and conditions of the eGenix.com Commercial License Agreement, Version 1.3.0 (PDF file).
When purchasing a license for the mxODBC product, you will receive a digitally signed Proof of Authorization together with a license file authorizing you to install and use the product.
If you would like to evaluate the eGenix.com mxODBC Distribution, please request an evaluation license or send an email to the eGenix.com Sales Team and include the following information: name of the licensee, number of evaluation licenses.
We will then send you the requested number of evaluation licenses for the mxODBC Professional Edition. The evaluation licenses have a built-in timeout of 30 days, but are otherwise fully functional.
If you are satisfied with the product, you can then proceed to the next section.
Production licenses for the mxODBC product can be bought via our eGenix.com Online Shop. Licenses are sold per Python installation. If you are installing the product on a shared server which is accessible over a network, then you have to purchase a separate license for each machine that can access the installation via this server.
For prices, volume discounts, site and corporate licenses please, write to sales@egenix.com for quotes.
After purchase, you will receive the necessary license files from eGenix.com within two business by email to the shipping address you specified in the ordering process.
If you need to buy licenses for third parties (e.g. as contractor or reseller), please consult sales@egenix.com for instructions.
If you have questions about the ordering process, or the needed number of licenses, please write to the eGenix.com Sales Team.
mxODBC licenses are available in different editions to meet your specific needs. The edition features are enabled via the license files that you receive after purchase. The download packages are the same for all editions.
The Professional Edition License
allows installation of mxODBC for use
in one Python installation. There is no limitation on the database
backend, the number of open connections per process, or the platform - you can benefit
from the full mxODBC functionality on all supported platforms.
This edition is ideal for users in professional settings and in situations where the number of connections should not be limited, e.g. in a web server environment.
If you are intending to upgrade from an existing mxODBC license to the new mxODBC 3.3, please contact the eGenix.com Sales Team with your existing license serials for details for an upgrade discount coupon.
We will give out 20% discount coupons for upgrade purchases going from mxODBC 2.x to 3.3 and 50% coupons for upgrades from mxODBC 3.x to 3.3. After upgrade, use of the original license from which you upgraded is no longer permitted.
For developers who want to integrate mxODBC into an application or product, we offer a Product Development Edition License which allows royalty-free redistribution of mxODBC as part of a product built by a developer.
Developer licenses for the mxODBC product can be bought via our eGenix.com Online Shop.
Licenses are sold per developer and product, e.g. if you have one developer
working on two products integrating mxODBC, you will need to purchase
two licenses. If you have three developers working on one product, you
will need to purchase three licenses in order to benefit from the
royalty-free distribution right.
For quotes on prices and volume discounts please contact the eGenix.com Sales Team.
If you are looking for upgrades to your existing mxODBC Developer CPU Licenses or mxODBC Product Development Edition Licenses, we will provide you with upgrade coupons. Please contact eGenix.com Sales Team with your existing license serials for details for an upgrade discount coupon.
We will give out 20% discount coupons for upgrade purchases going from mxODBC 2.x to 3.3 and 50% coupons for upgrades from mxODBC 3.x to 3.3. After upgrade, use of the original license from which you upgraded is no longer permitted.
Please note that we have changed the licensing scheme for mxODBC development licenses to a per-developer and product based one in 3.1 and later, to better meet our customer's requirements. If you have questions, please contact the eGenix.com Sales Team.
If you want to redistribute mxODBC as part of a product on a per-installation basis (rather than on a per developer and product basis), you can do so by purchasing standard or professional edition licenses in bulk and then redistribute these to your customers.
For larger volumes we also have a special reseller agreement to simplify the process. Please write to the eGenix.com Sales Team for instructions and more information.
The following documentation is available for mxODBC:
mxODBC User Manual and Reference Guide - HTML and PDF
The manual includes a comprehensive installation guide, a discussion of the design principles behind mxODBC, as well as a reference of the available programming interfaces. With over 200 pages it provides a very detailed overview of the many professional features in mxODBC.
The PDF file is also available as part of the installation and can be found in the mx/ODBC/Doc/
folder.
"Python Programming On Win32" by Mark Hammond, Andy Robinson has a section on mxODBC and mxDateTime.
A successful installation of mxODBC requires these three steps:
Redistribution of these files is not allowed. Please contact the eGenix Sales Team for details about redistribution possibilities and terms.
On Unix it is important to know whether you need to download a distribution for a narrow Unicode build of Python (UCS2) or a wide version (UCS4).
Most Unixes ship with wide Python builds these days (including RedHat and SuSE). In order to make sure, please run the following command which will tell you what kind of Python installation you have:
python -c "import sys;print(sys.maxunicode<66000)and'UCS2'or'UCS4'"
If you get errors such as "unresolved symbol PyUnicodeUCS2_AsEncodedString" when trying to load an extension from the distribution, you have likely installed an archive for a wrong Unicode version.
For full details on how to install, setup and configure mxODBC, please see the mxODBC User Manual. It is available as PDF for offline reading and HTML for online reading:
mxODBC User Manual and Reference Guide - HTML and PDF
What follows is a short summary:
The web installer is available for download on the product's Python Package Index (PyPI) page. Installation tools will automatically pick up this installer when used without any extra options or URLs.
The web installer will then determine the installation platform,
select the right binary download package and install the corresponding
prebuilt archive for you. If the web installer fails to find a suitable
binary, please try one of the other methods explained below and report
the problem to our support team.
Note that should still install the eGenix.com mx Base Distribution before proceeding with the following steps as explained in the download section. The egenix-mxodbc package includes a requirement for the egenix-mx-base package, so most installers will attempt to install egenix-mx-base automatically.
setuptools' easy_install:
easy_install egenix-mxodbc
pip installer:
pip install egenix-mxodbc
zc.buildout configuration manager:
builout.cfg:
eggs += egenix-mxodbc
Download and unzip the installer from PyPI and run:
cd egenix-mxodbc-3.3.6
python setup.py install
Installation using the Windows installers is straight forward: just double-click on the installer EXE or MSI file and follow the instructions.
Both installers register the distribution with the Windows software registry, so you can easily uninstall the distribution should you require to do so.
With the MSI installer you also have the option to run the installer without the GUI or to integrate it into an automatic installation process. Please see the MSI installer documentation on the Python web-site for details.
To uninstall the distribution, please use the standard Windows software registry.
To reduce the number of binaries that we have to create for each release, we have adapted a new generic distribution format that works on all Python platforms: the Prebuilt Distribution Format.
Technically, this format is a standard Python distutils distribution, but with only the build/
directory and without the source tree.
In order to install such a distribution, please follow these instructions:
sudo python setup.py installOn Windows and some other platforms that don't have
sudo
, please run the above without sudo
as administrator or root.The distribution will then be installed into the standard directory
for Python extensions of your Python installation (usually the site-packages/
subdirectory of the Python standard library directory).
To uninstall, follow the same steps as above, but use the command uninstall
instead:
sudo python setup.py uninstall
You will need to be able to sudo on the target machine or know the
root password for the above to work. If you don't have permission to
install packages as root, you can still install the distribution into a
local directory, e.g. ~/lib/python
by using the following installation command:
python setup.py install --home=/home/user/
This will install the distribution into the directory /home/user/lib/python/
.
In order to have Python see this directory and make it useable for
import, you have to adjust the PYTHONPATH environment variable to
include this directory, e.g.
export PYTHONPATH /home/user/lib/python
To see all the possible installation options, run the install script using the help options:
python setup.py install --help
To uninstall, follow the same steps as above, but use the command uninstall
instead:
sudo python setup.py uninstall --home=/home/user/
The egg archives we provide are made available through two PyPI-style indexes which the egg tools setuptools/easy_install/pip/zc.buildout can access to automatically download and install the right egg archive.
There are two indexes, one for Python UCS2 builds:
https://downloads.egenix.com/python/index/ucs2/
and one for Python UCS4 builds:
https://downloads.egenix.com/python/index/ucs4/
If you are using a Python UCS2 build, then you can install the egg archives using this command:
easy_install -i https://downloads.egenix.com/python/index/ucs2/ \
egenix-mxodbc
For UCS4 builds, please use this command:
easy_install -i https://downloads.egenix.com/python/index/ucs4/ \
egenix-mxodbc
The command line parameters for other tools such as pip are similar. Please consult their documentation for details.
In some cases, easy_install and other download tools cannot map the platform name to the name used in the egg archive. If you get errors during the installation, please manually download the right egg archive and then run the command directly on the downloaded egg archive:
easy_install \
egenix_mxodbc-3.3.6-py2.7-macosx-10.5-x86_64.egg
The licenses you receive from eGenix after purchase or request of an evaluation license are packaged as ZIP file having one directory per license file set.
In order to install the license file set to a specific Python
installation, please unzip the license ZIP file and copy the two files mxodbc_license.py
and mxodbc_license.txt
from the license directory to a directory on your Python installation's sys.path / PYTHONPATH
, e.g. to the Python installation's site-packages/
directory.
mxODBC will then pick up the license files from there during startup.
eGenix offers these support options:
Professional level support for this product as well as all other eGenix products and Python itself is available directly from the developers at eGenix.com.
eGenix.com offers professional consulting services for all questions and tasks around this product, including customized modifications, help with integration and on-site problem solving. Please contact sales@egenix.com for details.
In order for our users to keep in touch and be able to help themselves, we have created the egenix-users user mailing list.
mxODBC is in production use by several Fortune-500 companies, including Intel, IBM, Google and Royal Bank of Scotland.
Several of these have integrated mxODBC into their products, e.g. InfoSeek in the UltraSeek enterprise search engine, which was later sold to Inktomi, Verity, Autonomy and then HP.
Please see the mxODBC References & Quotes page for more details or write to sales@egenix.com for more information.
Please see the change log for details regarding changes to the package between releases.
Older versions of mxODBC, which are still available: