How to Install the Firebird ODBC Driver on Linux
By Pavel Cisar
The unixODBC package must be installed Firebird must also be installed
The ODBC driver packages for Linux are gzipped tar files. After gunzip they should be processed by tar, or you can rename them to *.tar.gz and use Midnight Commander to unpack them (for example).
To build from sources (recommended), requires the development package for unixODBC:
- Download and unpack the Firebird driver sources
- Rename "makefile.linux" in .source/Builds/Gcc.lin to "makefile"
- Set the evironment variables FBINCDIR (Firebird include directory) and FBLIBDIR (Firebird lib directory) if necessary.
- Run make (this creates the library libOdbcFb.so in a subdirectory)
- It's possible to copy the library to /usr/local/lib64 (or any preferred directory) or run: make install (this symlinks the library from the unixODBC directory)
To install from the binary package:
- Copy libOdbcFb.so to /usr/local/lib64 or any other desired destination directory.
Configuration, depends on the Linux distribution, but somewhere in /etc or /etc/unixODBC should be two files:
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
You can test the connection using UnixODBC ISQL (not Firebird's) using the following:
isql -v employee
If you have connection problems, make sure that the directory where you placed the Firebird ODBC shared library (/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 then the next thing is to try the following and see if you can see what the problem is.
strace -o output.txt isql -v employee