php – 无法连接到iSeries odbc
作者:互联网
我花了很多时间试图解决这个问题.所以也许有人可以帮我在这里,请:(.
我得到了一个ibm-iaccess64.rpm然后使用外星人将其转换为deb.然后安装它:sudo dpkg -i ibm-iaccess64.deb.这是成功的.
然后在我的/etc/odbcinst.ini中我有这个配置:
[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
然后我试了isql -v ISERIES给了我这个错误:
[01000][unixODBC][Driver Manager]Can’t open lib
‘/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so’ : file not found
[ISQL]ERROR: Could not SQLConnect
我检查了文件路径,并且libcwbodbc存在>.< ... 希望有人能在这里帮助我:(.非常感谢
解决方法:
我遇到了同样的问题,所以我想发帖说我发现了一个问题.
错误有点误导,应该说图书馆有问题.您可以通过对它运行ldd来看到这一点,这将显示它可能显示它缺少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)
您可以通过符号链接so.1来“修复”
sudo ln -s /usr/lib/x86_64-linux-gnu/libodbcinst.so.1 /usr/lib/x86_64-linux-gnu/libodbcinst.so.2
我在this上发了一篇完整的odbc文章,你可能觉得它很有用.
标签:php,odbc,db2,unixodbc 来源: https://codeday.me/bug/20190824/1711656.html