I want to connect R to Athena in AWS so that I can get a table from the database into R. So I went online and I googled how to do this. I found this website here. That told me that I need to install drivers. I have a mac (which is also new to me) and I found under the section mac on this website that I need to install homebrew which I did. I then followed these next steps in the terminal.
Install UnixODBC, which is required for all databases
brew install unixodbc
Install common DB drivers (optional)
brew install freetds --with-unixodbc
brew install psqlodbc
I dont usually work in the terminal. So Im not too familiar with it. Anyways I thought that did it so I ran the following code.
con <- DBI::dbConnect(
odbc::odbc(),
Driver = "FreeTDS",
S3OutputLocation = " etc..",
AwsRegion = "etc..",
AuthenticationType = "...",
Schema = "...",
UID = rstudioapi::askForPassword("AWS Access Key"),
PWD = rstudioapi::askForPassword("AWS Secret Key")
)
When I ran this code I got the following error:
Error: nanodbc/nanodbc.cpp:983: 00000: [unixODBC][Driver Manager]Can't open lib 'FreeTDS' : file not found
Of course I googled the error and I found some interesting stuff on stack exchange. After playing around in the terminal though I got these responses:
sudo Rscript -e 'odbc::odbcListDrivers()'
[1] name attribute value
<0 Zeilen> (oder row.names mit Länge 0)
Showing zero rows and row.names with a length of 0.
I also ran this
cp /etc/odbcinst.ini ~/.odbcinst.ini && Rscript -e 'odbc::odbcListDrivers()
and I get this
cmdand quote> '
cp: /etc/odbcinst.ini: No such file or directory
I don't understand why this is the case because I completed steps one and two.