Skip to content

Need help connecting to Amazon Redshift using odbc driver in RStudio (MacOS)

0

Hello,

I am desperately needing help connecting to Amazon Redshift server using an odbc driver. I have followed the "Configuring an ODBC connection" seen here: https://docs.aws.amazon.com/redshift/latest/mgmt/configure-odbc-connection.html#obtain-odbc-url, but unable to figure out what's wrong with my setup.

I have tried the code suggested by R like this:

con <- DBI::dbConnect(odbc::odbc(), Driver = "/opt/amazon/redshift/lib/amazonredshiftodbc.dylib", Host = "rhealth-prod-4.cldcoxyrkflo.us-east-1.redshift.amazonaws.com", Schema = "dev", Port = 5439)

I get the following error: Error: nanodbc/nanodbc.cpp:1118: 00000: [Amazon][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function: [Amazon][DSI] An error occurred while attempting to retrieve the error message for key 'LibsLoadErr' with message parameters ['""'] and component ID 3: Message not found in file "/opt/amazon/redshift/ErrorMessages/en-US/ODBCMessages.xml"

The odbc.ini and odbcinst.ini files are in my /User/ location so I shouldn't need to set environment variables, unless I am missing something, but here are my configuration files:

odbc.ini:

[ODBC Data Sources] Amazon_Redshift_dylib=Amazon Redshift DSN for macOS X

[Amazon Redshift DSN for macOS X] Driver=/opt/amazon/redshift/lib/amazonredshiftodbc.dylib Host=rhealth-prod-4.cldcoxyrkflo.us-east-1.redshift.amazonaws.com Port=5439 Database=saf locale=en-US

odbcinst.ini:

[ODBC Drivers] Amazon_Redshift_dylib=Installed

[Amazon_Redshift_dylib] Description=Amazon Redshift DSN for macOS X Driver=/opt/amazon/redshift/lib/amazonredshiftodbc.dylib

Any insight would be greatly appreciated.

asked 4 years ago1.2K views

2 Answers
0

After installation of Redshift ODBC drivers you also need to configure

Refer Use an ODBC driver manager to configure the driver on Linux and macOS X operating systems

AWS
EXPERT

answered 4 years ago

0

Hi, We have noted that Amazon will end support for the Redshift ODBC 1.x driver on September 30, 2026: https://docs.aws.amazon.com/redshift/latest/mgmt/behavior-changes.html

Currently, we are running Tableau Server on Ubuntu, and AWS does not provide the newer Redshift ODBC driver version for Ubuntu: https://docs.aws.amazon.com/redshift/latest/mgmt/odbc20-install-linux.html

Could you please confirm if there is any plan for the Redshift ODBC 2.0 driver to be made available for Ubuntu?

answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.