ODBC Athena connection Error: Unable to locate SQLGetPrivateProfileString function.

I can connect RStudio to Athena via JDBC, but when I try to use an ODBC driver I get the error message:

Error: nanodbc/nanodbc.cpp:1021: 00000: [Simba][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function.

I have searched for this error online and tried the solutions (e.g., ensuring I have only one odbc.ini and one odbcinst.ini file on my Mac). but the error persists? I know that my credentials are valid because I can connect via JDBC, but I'd like to take full advantage of ODBC perks in RStudio. How can I resolve this error?

1 Like

I'm having the same issue with AWS Redshift over ODBC on a Mac with Catalina. Did you find a solution?

Hi @joepowers16,

I am not 100% sure how to fix your odbc issue however I can recommend an alternative method to connect to AWS Athena from R. Have you considered looking at RAthena or noctua? They both integrate with RStudio and take advantage of the connection tab that RStudio provides.

They connect through AWS SDK's so there is no need to install / setup odbc drivers on your mac (which can be tricky). RAthena connects using python through the reticulate package. noctua uses R AWS SDK paws (so no python setup is required).

I hope this helps :slight_smile:


I managed to get Redshift working by adding:
ODBCInstLib = /usr/local/lib/libodbcinst.dylib

to /opt/amazon/redshift/lib/amazon.redshiftodbc.ini.

1 Like