Tech Monger

Programming, Web Development and Computer Science.

Skip to main content| Skip to information by topic

AWS Redshift ODBC Connection - Redhat Linux

In this tutorial, we will download & Install ODBC driver for the Amazon Redshift Database in Redhat Linux. We will make ODBC entry which will help us connect to the AWS Redshift.


Download and Install AWS Redshift ODBC Drivers

Download the latest Amazon Redshift Drivers for Linux from AWS website.

curl https://s3.amazonaws.com/redshift-downloads/drivers/odbc/1.4.27.1000/AmazonRedshiftODBC-64-bit-1.4.27.1000-1.x86_64.rpm

Driver Installation Steps

  1. Create directory to store driver binaries
  2. mkdir /path/to/odbc-drivers/redshift/
  3. Copy driver rpm file in above directory
  4. cp AmazonRedshiftODBC-64-bit-1.4.27.1000-1.x86_64.rpm /path/to/odbc-drivers/redshift/
  5. Install Driver with Root User
  6. sudo su - root
    yum --nogpgcheck localinstall AmazonRedshiftODBC-64-bit-1.4.11.1000-1.x86_64.rpm
  7. Verify the Driver Path
  8. After installation following directory shall get created with drive.

    Directory : /opt/amazon/redshiftodbc/
    Driver : /opt/amazon/redshiftodbc/lib/64/libamazonredshiftodbc64.so
  9. Create ODBC Entry inside odbc.ini
  10. [AWS_RedShift]
    Driver=/opt/amazon/redshiftodbc/lib/64/libamazonredshiftodbc64.so
    Description=Amazon Redshift ODBC driver
    Database=DBNAME
    Host=example.redshift.amazonaws.com
    Port=5439
    UserName=DB_USER
    Password=DB_PASSWORD
    CharacterSet=UTF8
    DateTimeFormat=AAA
    RETRYONEINTR=YES
    LoginTimeout=1000
    

Conclusion

We configured ODBC connection for the Redshift DB. You can use this ODBC entry from tools like PyODBC, Informatica etc to communicate with the Redshift Database.

Tagged Under : Informatica Linux ODBC Open Source