Needs Expansion
This article is incomplete, and needs to be expanded. More info...

Ubuntu supports ODBC connections to databases (such as a remote MySQL server). Whilst this is not normally useful, The database in OpenOffice can use ODBC connections, and it may be convenient to set one up.

Installing the MySQL Database ODBC Driver

Get the linux MySQL ODBC driver. The console incantation is

 apt-get install libmyodbc

and synaptic will provide a similar install.

Now hand edit (or create, if it does not exist already) /etc/odbc.ini

Here's an example odbc.ini:

[ODBC Data Sources]
odbcname     = MyODBC 3.51 Driver DSN

Driver       = /usr/lib/odbc/libmyodbc.so
Description  = MyODBC 3.51 Driver DSN
SERVER       = my.database.server.com
PORT         =
USER         = USER
Password     = XXXXXX
Database     = DBNAME
OPTION       = 3
SOCKET       =

Driver       = /usr/local/lib/libmyodbc3.so
Description  = MyODBC 3.51 Driver DSN
SERVER       = localhost
PORT         =
USER         = root
Password     =
Database     = test
OPTION       = 3
SOCKET       =

It is now possible to connect to the database DBNAME using the ODBC connection odbcname

NB: On Ubuntu Trusty 14.04 LTS (32-bit), replace the Driver value above with  /usr/lib/i386-linux-gnu/odbc/libmyodbc.so 

Installing the Firebird Database ODBC Driver

The Firebird ODBC driver is not in the Ubuntu repositories so it has to be downloaded from the FirebirdSQL site:


It contains a single file named "libOdbcFb.so". Copy this file to the /usr/lib directory.

Next make sure you have the Firebird client library installed:

apt-get install libfbclient2

Openoffice and probably a few other programs will insist on using a driver named libgds.so for connecting to a Firebird database. A symbolic link will have to be created:

ln -s /usr/lib/libfbclient.so.2 /usr/lib/libgds.so

At this point you are ready to add some entries to the odbc config files. If they don't already exist you can create them.

Here's another example odbc.ini:

Description = Firebird
Driver = Firebird
Dbname = localhost:/var/lib/firebird/2.1/data/employee.fdb
Password = xxxxx
Role =
CharacterSet =
ReadOnly = No
NoWait = No

And the relevant entries for the odbcinst.ini file:

Description = InterBase/Firebird ODBC Driver
Driver = /usr/lib/libOdbcFb.so
Setup = /usr/lib/libOdbcFbS.so
Threading = 1
FileUsage = 1
CPTimeout =
CPReuse =

You should now be able to connect to DBNAME from OpenOffice or other programs using the ODBC connection method.

ODBC (last edited 2014-07-10 01:55:30 by knoxg)