ODBC installation and configuration

Installation

validation-status-icon-error WARNING

MySQL database is supported up to version 5.7 and ODBC driver up to version 5.3.10. Upgrading to a higher version (5.3.11 or 8.x) of MySQL and ODBC driver is not recommended.

It is recommended to install the MySQL ODBC driver version 5.2.

Debian and Ubuntu distributions require also the libmyodbc package:

sudo apt-get install libmyodbc

validation-status-icon-infoNOTE: Since Ubuntu 16.04.1 LTS and Debian 9, the libmyodbc package was removed from the official Ubuntu repository. We recommend you download a separate package from the official site and install it. However, this package will not be updated by Ubuntu's apt-get upgrade method and would require manual upgrade.


Configuration

Run the following command to open the odbcinst.ini file in a text editor:

sudo nano /etc/odbcinst.ini

Copy the following configuration into the odbcinst.ini file (make sure the paths to Driver and Setup are correct), then save and close the file:

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1

If you are using a 32-bit Ubuntu version, use Driver and Setup keys and change the path to:
/usr/lib/i386-linux-gnu/odbc/

The Driver may be in a different location for some distributions. You can find the file using the following command:

sudo find /usr -iname "*libmyodbc*"

ERA products require the MySQL driver to support multi-threading. This is the default for newer unixODBC package versions (2.3.0 or newer). Older versions require explicit threading configuration. If you have an older version (command odbcinst --version will show you your version), add the following parameter to the odbcinst.ini file:

Threading = 0

Update the configuration files that control ODBC access to database servers on the current host by running the following command:

sudo odbcinst -i -d -f /etc/odbcinst.ini