FirebirdSQL logo

Configuring a DSN on Linux

Pavel Cisar

Configuration depends on the Linux distribution but, somewhere in /etc or /etc/unixODBC, should be two files named odbc.ini and odbcinst.ini.

Add to odbcinst.ini:

[Firebird]
Description     = InterBase/Firebird ODBC Driver
Driver          = /usr/local/lib64/libOdbcFb.so
Setup           = /usr/local/lib64/libOdbcFb.so
Threading       = 1
FileUsage       = 1
CPTimeout       =
CPReuse         =

Add to odbc.ini:

[employee]
Description     = Firebird
Driver          = Firebird
Dbname          = localhost:/opt/firebird/examples/empbuild/employee.fdb
User            = SYSDBA
Password        = masterkey
Role            =
CharacterSet    =
ReadOnly        = No
NoWait          = No

Testing the Configuration

UnixODBC has a tool named ISQL (not to be confused with Firebird’s tool of the same name!) that you can use to test the connection, as follows:

isql -v employee

If you have connection problems, make sure the directory where you placed the Firebird ODBC shared library, e.g. /usr/local/lib64/libOdbcFb.so, is on the system loadable library path.If not you could set:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/odbc

or, more simply,

export LD_LIBRARY_PATH=/usr/lib/odbc

If you still have problems, the next thing is to try an strace to try to identify them:

strace -o output.txt isql -v employee