[HowTo] Install ODBC Driver For MySQL On Ubuntu

ODBC or Open Database Connectivity provides a standard software interface for accessing database management systems (DBMS). ODBC could work in multi-platform environments. With the ODBC API, the application only needs to know ODBC syntax, and the driver can then pass the query to the DBMS in its native format, returning the data in a format the application can understand.

As ODBC works in multi-platform environments, ODBC can work on Ubuntu as well. For software developers they use ODBC so their application can work on any platform. To install ODBC on Ubuntu follow the steps below:

1. Open your terminal, install iodbc

sudo apt-get install iodbc

2. Install MySQL connector for ODBC

sudo apt-get install libmyodbc

3. Start iodbc

iodbcadm-gtk

This will open the iodbc GUI management.

4. Now add MySQL driver to ODBC
In the ODBC driver tab, add a driver, give any description you want, and
For “Driver file name” choose /usr/lib/odbc/libmyodbc.so.
For “Setup file name” choose /usr/lib/odbc/libodbcmyS.so.

5. Create a new User DSN
Click Add, and give a name to your datasource (example: “my_mysql_odbc”). Then give these information:
server -> Your MySQL server
database -> database name
user -> user that has access to the database
password -> user password

Now you can use this ODBC driver in your application just like in a Windows environment. When your application is ready to deploy, you just need to set up the ODBC driver on the other platform and your application will run as usual.