Needed some help on connecting to a sql server running as a docker container on macOS. I am trying to use the odbc
package to connect to the database. I installed unixODBC
using home brew. However when I run odbcListDrivers
it shows me no drivers. This is what odbcinst -j
shows :
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/dhirajkhanna/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
This is what exists in my /etc/odbcinst.ini
[Simba SQL Server ODBC Driver]
Driver = /Library/simba/sqlserverodbc/lib/libsqlserverodbc_sbu.dylib[FreeTDS]
Description=FreeTDS Driver for Linux & MSSQL
Driver=/usr/local/lib/libtdsodbc.so
Setup=/usr/local/lib/libtdsodbc.so
UsageCount=1
And this is what exists in my ~/.odbcinst.ini
[FreeTDS]
Description = FreeTDS Driver for Linux & MSSQL
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsodbc.so
UsageCount = 1[ODBC Drivers]
Simba SQL Server ODBC Driver = Installed[Simba SQL Server ODBC Driver]
Driver = /Library/simba/sqlserverodbc/lib/libsqlserverodbc_sbu.dylib
But for some reason odbc::odbcListDrivers()
gives me this:
[1] name attribute value
<0 rows> (or 0-length row.names)
Here's my session info:
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.5
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DBI_1.1.0 odbc_1.2.2.9000
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 digest_0.6.25 evaluate_0.14 rlang_0.4.6.9000 blob_1.2.1 vctrs_0.3.1.9000 rmarkdown_2.1 tools_3.6.3 bit64_0.9-7 bit_1.1-15.2
[11] hms_0.5.3 xfun_0.14 yaml_2.2.1 compiler_3.6.3 pkgconfig_2.0.3 htmltools_0.4.0 knitr_1.28