I'm trying to connect my work db via Informix to create a script but I have problems in the connection.
The error is:
Traceback (most recent call last):
File "./Test1.py", line 11, in <module>
con = pyodbc.connect(constr, autocommit=False)
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/IBM/informix/lib/cli/iclit09b.so' : file not found (0) (SQLDriverConnectW)")
But actually I have this file on the machine, so I used ldd
and found the real error is that the libraries libifgls.so
and libifglx.so
are not found:
[jordaz@localhost scripts]$ ldd /opt/IBM/informix/lib/cli/iclit09b.so
linux-gate.so.1 => (0xf777f000)
libifgls.so => not found
libifglx.so => not found
libpthread.so.0 => /lib/libpthread.so.0 (0xf75db000)
libc.so.6 => /lib/libc.so.6 (0xf741d000)
libm.so.6 => /lib/libm.so.6 (0xf73d9000)
libdl.so.2 => /lib/libdl.so.2 (0xf73d4000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xf73a4000)
/lib/ld-linux.so.2 (0xf7780000)
libfreebl3.so => /lib/libfreebl3.so (0xf73a0000)
and my /etc/odbcinst.ini
[cms]
Description = MySQL connection to 'Kkapd' database
Driver = MySQL
Database = cms
Server = 10.177.3.100
Port = 50005
Socket = /var/lib/mysql/mysql.sock
[Informix]
Description =Informix Driver
Driver =/opt/IBM/informix/lib/cli/iclit09b.so
APILevel =1
ConnectFunctions =YYY
DriverODBCVer =03.00
FileUsage =0
SQLLevel =1
smProcessPerConnect =Y
and my /etc/odbc.ini
[cms]
Description = MySQL connection to 'Kkapd' database
Driver = MySQL
Database = cms
Server = 10.177.3.100
Port = 50005
Socket = /var/lib/mysql/mysql.sock
[Informix]
Description =Informix Driver
Driver =/opt/IBM/informix/lib/cli/iclit09b.so
APILevel =1
ConnectFunctions =YYY
DriverODBCVer =03.00
FileUsage =0
SQLLevel =1
smProcessPerConnect =Y
How can I fix this so that I can connect properly?
I updated the PATHS so I duobled checked with ldd but the problem is that i got the files but still the same error:
[informix@localhost scripts]$ ldd /opt/IBM/informix/lib/cli/iclis09b.so
linux-gate.so.1 => (0xf7786000)
libifgls.so => /opt/IBM/informix/lib/esql/libifgls.so (0xf75c1000)
libifglx.so => /opt/IBM/informix/lib/esql/libifglx.so (0xf75bf000)
libc.so.6 => /lib/libc.so.6 (0xf73f8000)
libm.so.6 => /lib/libm.so.6 (0xf73b4000)
libdl.so.2 => /lib/libdl.so.2 (0xf73af000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xf737f000)
libpthread.so.0 => /lib/libpthread.so.0 (0xf7364000)
/lib/ld-linux.so.2 (0xf7787000)
libfreebl3.so => /lib/libfreebl3.so (0xf7360000)
I actually altered the /etc/ld.so.conf
when I installed Informix this the file:
include ld.so.conf.d/*.conf
/home/informix/lib/cli
/home/informix/lib/esql
/home/informix/lib
export INFORMIXDIR=/home/informix
export PATH=$INFORMIXDIR/bin:$PATH
export LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH
export TERMCAP=$INFORMIXDIR/etc/termcap
export TERM=vt100
export DBDATE=DMY4/
export DBCENTURY=C
export DBEDIT=nano
export VISUAL=nano
export INFORMIXSERVER=cms_net
export ONCONFIG=onconfig.cms
export INFORMIXSQLHOSTS=/home/informix/etc/sqlhosts
export ODBCINI=/etc/odbc.ini