SQLite3ODBC installation

Prerequisites :

sqlite3, sqlite3-devel, unixODBC, unixODBC-devel


[PS: Use latest version, currently sqliteodbc-0.9993]

wget http://www.ch-werner.de/sqliteodbc/sqliteodbc-0.9993.tar.gz
tar -xvf sqliteodbc-0.9993.tar.gz
cd sqliteodbc-0.9993
make;make install
yes | cp sqliteodbc.h sqlite3odbc.h sqlite4odbc.h /usr/include/

unlink /usr/lib/libsqliteodbc.so
ln -s /usr/local/lib/libsqlite3odbc-0.9993.so /usr/lib/libsqliteodbc.so
cd ..
rm -rf sqliteodbc-0.999*


Configure INI files:

=> /etc/odbc.ini

Description = My SQLite test database
Driver = SQLite
Database = /tmp/test.db

Trace = Yes
TraceFile = /tmp/sqlite.log

=> /etc/odbcinst.ini

Description = SQLite3 ODBC Driver
Driver = /usr/local/lib/libsqlite3odbc.so
Setup = /usr/local/lib/libsqlite3odbc.so
Threading = 2
gsageCount = 3

Trace = Yes
TraceFile = /tmp/sqlite.log
UsageCount = 2



===> Driver installation

odbcinst -i -d -f /etc/odbcinst.ini
odbcinst -i -s -l -f /etc/odbc.ini
odbcinst -s -q

===> Verify Installation

odbcinst -j         # to check the ODBC version and configuration.

odbcinst -q -d   # View loaded drivers.

odbcinst -q -s   # View DSN entry

sqlite3 /tmp/test.db “”  # This will create an empty database for testing

isql -v mysqlitedb  #This command is to make sure that odbc is configured properly, this command should show “connected” after proper installation of sqlite and odbc

quit #To come out from isql prompt


One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s