1

I am trying to use python with a teradata module but I can't connect to the teradata server:

Versions

  • python 3.6
  • teradata 16.20.0.7

I have tried to install 3 different packages so far:

  • teradata (doesn't seem to support teradata version 16)
  • teradatasql 16.20.0.9: see code attempt below.
  • teradatasqlalchemy: 16.20.0.7

My attempt with teradatasql:

con = teradatasql.connect(None, host='my_teradata_server_name',
         user='my_username', password='my_password', logmech='ldap')

This gave error message:

File "my_virtual_en_path\lib\site-packages\teradatasql__init__.py", line 110, in init raise OperationalError(sErr) teradatasql.OperationalError: [Teradata SQL Driver] [Session 0] Failed to connect to my_teradata_server_name:1025

My attempt with sqlalchemy:

from sqlalchemy import create_engine
td_engine = create_engine('teradata://my_username:my_password@my_server_name.com')

This gave error message: "Can't load plugin: %s:%s" % (self.group, name)

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:teradata

FYI I have without success tried to follow: Connecting to Teradata using Python

Nickolay
  • 31,095
  • 13
  • 107
  • 185
Filip Eriksson
  • 975
  • 7
  • 30
  • 47
  • 3
    For teradatasqlalchemy, the dialect name needs to be *teradatasql* not teradata. And if you can't connect with teradatasql alone then adding the sqlalchemy layer won't help. Would be nice to know why it failed to connect... You might try using an IP address for host= instead of server name. Out of habit I generally use upper case for LDAP but I don't think that matters. – Fred Aug 13 '19 at 20:27
  • Are you sure you need `logmech="ldap"`? (The docs spell it in upper-case, like Fred mentions). Can you connect from bteq? With what parameters? Alternatively, try setting [teradatasql's `log`](https://pypi.org/project/teradatasql/) (look for "Compose the value by adding together 1, 2, 4, and/or 8." on that page) – Nickolay Aug 16 '19 at 20:28

0 Answers0