Adding An ODBC Driver For MySQL On Ubuntu

Want to support HowtoForge? Become a subscriber!
 
Submitted by clawoo (Contact Author) (Forums) on Thu, 2009-01-15 09:36. :: Ubuntu | MySQL

Adding An ODBC Driver For MySQL On Ubuntu

Sometimes you may find the need to develop cross platform applications which make use of a database. ODBC can be a solution to your portability needs, but unfortunately it is not as easy to set up an ODBC connection on Linux as it is on Windows. This tutorial attempts to shed some light on this process by guiding you towards adding an ODBC driver on Ubuntu. The process described below has been tested on Ubuntu 8.04 and Ubuntu 8.10.

 

1. Install iodbc - GTK+ config frontend for the iODBC Driver Manager

sudo apt-get install iodbc

 

2. Install mysql connector for odbc

sudo apt-get install libmyodbc

 

3. Start iodbc

iodbcadm-gtk

 

4. Add the mysql driver to the list of ODBC drivers

Switch to the "ODBC Drivers" tab, click "Add a driver". Type in a description of the driver (i.e., "MySQL").

For "Driver file name" choose /usr/lib/odbc/libmyodbc.so.
For "Setup file name" choose /usr/lib/odbc/libodbcmyS.so.

This setup file appears to be supplied by unixodbc, which I already had installed.

 

5. Create a new User DSN (the procedure is the same for System DSN)

Click "Add", select the already created MySQL ODBC driver.

Give a name to your datasource (i.e.,"bobs_mysqldb").

You will now have to add a few keywords based on your server configuration. Minimally you should have:

    server
    database
    user
    password

The complete list of available keywords is documented on the MySQL connector page.

That's it.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Lutfi (not registered) on Fri, 2009-01-16 02:25.

On my Hardy, it's cannot start using "iodbcadm-gtk". But using "sudo iodbcadm-gtk" can running.

Submitted by Glenn (not registered) on Fri, 2009-11-27 08:11.
The odbc client closes everytime I click on the "Driver Tab" :(