在Linux上找不到Teradata驱动程序

时间:2016-12-27 08:58:43

标签: php ubuntu odbc teradata

我正在尝试在Linux上设置Teradata驱动程序并尝试从PHP(codeigniter)linux访问数据库。

$connection = odbc_connect('something@domain.com','USERNAME', 'PASSWORD');

我得到了

Message: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/opt/teradata/client/14.10/odbc_64/lib/tdata.so' : file not found, SQL state 01000 in SQLConnect

我检查过以下内容:

1)

 /opt/teradata/client/14.10/odbc_64/lib# ldd tdata.so   
            linux-vdso.so.1 =>  (0x00007fff7f39a000)
            libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8cb43f9000)
            libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8cb41e3000)
            libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8cb3fc4000)
            libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8cb3dc0000)
            librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f8cb3bb8000)
            libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f8cb399d000)
            libodbcinst.so => /opt/teradata/client/14.10/odbc_64/lib/libodbcinst.so (0x00007f8cb377f000)
            libddicu25.so => /opt/teradata/client/14.10/odbc_64/lib/libddicu25.so (0x00007f8cb2888000)
            libtdparse.so => /opt/teradata/client/14.10/odbc_64/lib/libtdparse.so (0x00007f8cb2712000)
            libicudatatd.so.46 => /opt/teradata/client/14.10/tdicu/lib64/libicudatatd.so.46 (0x00007f8cb1ec8000)
            libicuuctd.so.46 => /opt/teradata/client/14.10/tdicu/lib64/libicuuctd.so.46 (0x00007f8cb1c3b000)
            libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8cb1934000)
            libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8cb156f000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f8cb4ae5000)

因此,我可以确认没有库文件丢失。但是,我仍然得到上述错误。我已按照here步骤进行了操作。

2)odbc.ini

[ODBC Data Sources]
TDDSN=tdata.so

[ODBC]
InstallDir=/opt/teradata/client/14.10/odbc_64
Trace=0
TraceDll=/opt/teradata/client/14.10/odbc_64/lib/odbctrac.so
TraceFile=/usr/joe/odbcusr/trace.log
TraceAutoStop=0

[TDDSN]
Driver=/opt/teradata/client/14.10/odbc_64/lib/tdata.so
Description=Teradata database
DBCName=something@domain.com
Username=XXX
Password=XXX
Database=XXX

3)

isql -v tddsn <username> <password>
[ISQL]ERROR: Could not SQLConnect

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

我最终使用Teradata Node js并从我的PHP连接到nodejs webservice。这很简单。