Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to connect to iSeries odbc

I've spent a lot of hours trying to figure this out. So maybe anyone can help me out here, pls :(.

I was given an ibm-iaccess64.rpm then converted it to deb using alien. Then installed it: sudo dpkg -i ibm-iaccess64.deb. It was a success.

Then in my /etc/odbcinst.ini I have this config:

[ISERIES]
Description = iSeries Access ODBC Driver DSN for iSeries
Driver = iSeries Access ODBC Driver
System = 192.16.1.1
UserID = myuserid
Password = mypassword
Naming = 0
DefaultLibraries = QGPL
Database = MMGSTLIB
ConnectionType = 0
CommitMode = 2
ExtendedDynamic = 0
DefaultPkgLibrary = QGPL
DefaultPackage = A/DEFAULT(IBM),2,0,1,0,512
AllowDataCompression = 1
LibraryView = 0
AllowUnsupportedChar = 0
ForceTranslation = 0
Trace = 0

Then I tried isql -v ISERIES gave me this error:

[01000][unixODBC][Driver Manager]Can't open lib '/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so' : file not found [ISQL]ERROR: Could not SQLConnect

I checked the filepath and the libcwbodbc exists >.<...

Hope anyone can help me here :(. Thanks a many

like image 762
user2720708 Avatar asked Nov 30 '25 02:11

user2720708


1 Answers

I had the same problem as this so just wanted to post to say I found a fix;

The error is a little missleading, it should say the library has issues. You can see this by running ldd against it which will show probably show that it is missing libodbcinst.so.2

ldd /opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
linux-vdso.so.1 => (0x00007fff86dfe000)
**libodbcinst.so.2 => not found**
libcwbcore.so => /usr/lib/x86_64-linux-gnu/libcwbcore.so (0x00007f7f68545000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7f68240000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7f67f3a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7f67d24000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7f6795d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7f6773f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7f6753b000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7f67332000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7f68b98000)

You can put in a 'fix' by symbolic linking the so.1

sudo ln -s /usr/lib/x86_64-linux-gnu/libodbcinst.so.1 /usr/lib/x86_64-linux-gnu/libodbcinst.so.2

I posted a full odbc article on this which you might find useful.

like image 121
Stephen Dart Avatar answered Dec 02 '25 15:12

Stephen Dart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!