sqlalchemy-teradata icon indicating copy to clipboard operation
sqlalchemy-teradata copied to clipboard

Check that the ODBC driver is installed and the ODBCINI or ODBCINST environment variables are correctly set

Open ericman93 opened this issue 7 years ago • 2 comments
trafficstars

Starting a fresh new docker image, I'm running the following commands

alien -i drivers/teradata/15/tdicu1510-15.10.01.00-1.noarch.rpm
alien -i drivers/teradata/15/TeraGSS_linux_x64-15.10.01.01-1.noarch.rpm
alien -i drivers/teradata/15/tdodbc1510-15.10.01.01-1.noarch.rpm

export ODBCINI=/opt/teradata/client/15.10/odbc_64/odbc.ini
export ODBCINST=/opt/teradata/client/15.10/odbc_64/odbcinst.ini
export LD_LIBRARY_PATH=/opt/teradata/client/15.10/lib64/:$LD_LIBRARY_PATH

Trying to create a new connection ends up an error

connection_string = "teradata://user:password@host"
engine = create_engine(connection_string)
sessionmaker(bind=engine)().bind.connect()
sqlalchemy.exc.DatabaseError: (teradata.api.DatabaseError) (0, '[82] 523 80. Check that the ODBC driver is installed and the ODBCINI or ODBCINST environment variables are correctly set.')

I was trying different versions of teradata odbc provider and even using mysql's odbc-installer

myodbc-installer -d -a -n "Teradata" -t "DRIVER=/opt/teradata/client/15.10/lib64/libodbc.so"

But nothing seems to fix my issue

It seems that PyTd lets your change odbcLibPath path and this was a solution for some

ericman93 avatar Sep 27 '18 14:09 ericman93

What works for me is to see the output of the odbcinst -j command and note where the .ini file is being set.

I suggest checking out teradatasqlalchemy, it uses a driver that doesn't need ODBC.

sandan avatar Nov 06 '18 18:11 sandan

Yeah, I used teradatasqlalchemy :) Thanks

ericman93 avatar Nov 06 '18 20:11 ericman93