Posted: Mon, 15 Jun 2009 23:15:57 +0000
From: Ozz Nixon member since Jun 12 2009, has contibuted 79 messages.
Getting unixODBC for Linux(s)
deb/ubuntu: apt-get install unixODBC
rhel/fedora: yum install unixODBC
Configuration
/etc/odbcinst.ini
Is for the database libraries and configuring their parameters on a global level.
[PostgreSQL]
Description = PostgreSQL driver for Linux & Win32
Driver = /usr/local/lib/libodbcpsql.so
Setup = /usr/local/lib/libodbcpsqlS.so
FileUsage = 1
Threading = 2
/etc/odbc.ini
[PostgreSQL]
Description = Test to Postgres
Driver = PostgreSQL
Trace = Yes
TraceFile = sql.log
Database = nick
Servername = localhost
UserName =
Password =
Port = 5432
Protocol = 6.4
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =
Is for the actual alias used by your ODBC client. Now, if you cannot get root access to modify the odbcinst.ini file, you can replace the Driver = SectionName_in_odbcinst to the actual path, like so:
[PostgreSQL]
Description = Test to Postgres
Driver = /usr/local/lib/libodbcpsql.so
Trace = Yes
TraceFile = sql.log
Database = nick
Servername = localhost
UserName =
Password =
Port = 5432
Protocol = 6.4
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =
Sample for many databases
/etc/odbcinst.ini
[Mini SQL]
Description = MiniSQL
Driver = MiniSQL
Trace = No
TraceFile =
Host = localhost
Database =
ConfigFile =
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc.so
Setup = /usr/lib/libodbcmyS.so
UsageCount = 2
Trace = Off
TraceFile = stderr
[MySQL ODBC 3.51 Driver]
Description = ODBC 3.51 for MySQL
DRIVER = /usr/lib/libmyodbc3.so
SETUP = /usr/lib/libmyodbc3S.so
UsageCount = 2
Trace = Off
TraceFile = stderr
[FreeTDS]
Description = Tabular Data Stream protocol for MS SQL and Sybase
Driver = /usr/local/freetds/lib/libtdsodbc.so
[DB2_V8]
Description = DB2 v8.1 driver for Linux
Driver = /opt/IBM/db2/V8.1/lib/libdb2.so
Fileusage = 3
Dontdlclose=1
[DB2_V9]
Description = DB2 v9.5 driver for Linux
Driver = /opt/ibm/db2/V9.5/lib32/libdb2.so
Fileusage = 3
Dontdlclose=1
[DB2_EXP]
Description = DB2 v9.5 Express-C driver for Linux
Driver = /opt/ibm/db2exc/V9.5/lib32/libdb2.so
Fileusage = 3
Dontdlclose=1
[SQLite]
Description = SQLite ODBC Driver
Driver = /usr/lib/odbc/libsqliteodbc.so
Setup = /usr/lib/odbc/libsqliteodbc.so
UsageCount = 1
[OracleExpressdrv]
Description = Oracle 10g express driver
Driver = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/libsqora.so.10.1
Oracle in Client10_1 APILevel - 1
ConnectionFunctions = YYY
CPTimeout = 60
DriverODBCVer = 03.51
FileUsage = 0
SQLLevel = 1
Windows:
Driver = C:\Program Files\Oracle\Client10_1\SQORA32.dll
[owb1odbc]
Description = Oracle 10g R2 ODBC driver.
Driver = /opt/app/oracle/product/10.2.0/db_1/lib/libsqora.so.10.1
Setup =
FileUsage =
CPTimeout =
CPReuse =
UsageCount = 1
[Firebird]
Description = InterBase/Firebird ODBC Driver
Driver = /usr/lib/libOdbcJdbc.so
Setup = /usr/lib/libOdbcJdbcS.so
Threading = 1
FileUsage = 1
CPTimeout =
CPReuse =
/etc/odbc.ini
[MYSQL_TEST]
Driver = MySQL
SERVER = 192.168.1.26
USER = root
PASSWORD =
PORT = 3306
DATABASE = test
[nntp Data Source]
Description = nntp Driver
Driver = nntp Driver
Trace = No
TraceFile =
Host = localhost
Database =
Port =
[FreeTDS_Sample]
Driver = FreeTDS
Description = Northwind sample database
Trace = No
Server = 192.168.1.25
Database = Northwind
UID = sa
Port = 4444
PWD =
[Sybase SQL Anywhere 5.0]
Driver=Sybase SQL Anywhere 5.0
Description=Sybase SQL Anywhere 5.0 ODBC Driver
Userid=dba
Password=sql
DatabaseFile=sademo.db
[firebird_help]
Description = Firebird
Driver = Firebird
Dbname = localhost:/var/lib/firebird/2.0/system/help.fdb
User = SYSDBA
Password = masterkey
Role =
CharacterSet =
ReadOnly = No
NoWait = No
[ora102]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
CloseCursor = T
DisableDPM = F
DisableMTS = T
Driver = owb1odbc
DSN = ora102
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = owb1
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
UserID = std_rep