image1 image2 image3

HELLO I'M FERNANDO|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I'M PROFESSIONAL DEVELOPER

Installing Firebird ODBC driver on Ubuntu

Open Database Connectivity (ODBC) is a standard for accessing databases. ODBC is independent of programming language, database system and operating system.

 If we have it available in Ubuntu, we should install as follows: sudo apt-get install unixodbc unixodbc-dev

 The next thing we are going todo is install the driver we want to use to connect via ODBC. In this case we will install Firebird. 

The first thing you have to do is download the driver for Firebird: http://www.firebirdsql.org/en/odbc-driver/

In our case we have chosen: OdbcFb-LIB-2.0.0151.i686.gz (Linux x86)
Unpack the file " libOdbcFb.so" and copy to: /usr/lib
Then we make sure that we have installed the Firebird client library: sudo apt-get install libfbclient2
Perhaps Openoffice and other programs insist on using a driver with the name "libgds.so" to connect to the Firebird database. If this happens we will create a symbolic link as follows: ln -s /usr/lib/libfbclient.so.2 /usr/lib/libgds.so

At this point, we are ready to add some entries to the ODBC configuration file. If the files don't exist then create them.

We can create the files in:
/etc
ODBC.ini
[DBNAME] 
Description = Firebird 
Driver = Firebird 
Dbname = localhost:/var/lib/firebird/miBD.fdb 
User = SYSDBA 
Password = xxxxx 
Role = 
CharacterSet = 
ReadOnly = No 
NoWait = No

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

Now we will check that the connection actually works and can connect to the database: isql -v NombreBD +—————————————+ | Connected! | +—————————————+ 
SQL> select * from myTables; 

Attention: If you want to use ODBC from PHP, we run the following command: sudo apt-get install php5-odbc

 Finally add php.ini: [pdo] extension=pdo.so

Share this:

CONVERSATION

0 comentarios:

Post a Comment