- Run the following command to find the location of the Data Source configuration files.
odbcinst -j
The command lists the location of System DSN under SYSTEM DATA SOURCES and the location of User DSN under USER DATA SOURCES.
The default values are:
SYSTEM DATA SOURCES: /etc/odbc.ini
USER DATA SOURCES..: $HOME/.odbc.ini
In this output, System DSN is located in the /etc/odbc.ini, and User DSN is located in the $HOME/.odbc.ini.Note the location of the Data Source configuration files for your system.
- Add Data Source Name (DSN) to either of the configuration file based on your requirement.
Targeted users DSN to use All users of this system System DSN Specific to this user User DSN - Edit the System Data Source Name (DSN) in the configuration file you chose. For example:
[ODBC Data Sources] Teradata ODBC DSN = Teradata ODBC Driver 16.20 <DSN_name> = My DSN Description [<DSN_name>] Driver = /opt/teradata/client/16.20/odbc_64/lib/tdataodbc_sb64.so Description = Teradata database DBCName = <DBC_name> UID = <Username> PWD = <Password>
Keyword Description DSN_name An easy-to-recognize name for your database connection DBC_name Hostname or IP address of the Analytics Database Username Database user name Password Database user password Teradata recommends using a tdwallet string in the PWD field. For example, PWD = $(mypwd), where "mypwd' is a key in the tdwallet. - Test the connect.
isql <DSN_name>
- Edit the System Data Source Name (DSN) in the configuration file you chose. For example: