I'm trying to setup a CentOS 8 RStudio-Server to connect to MS SQL server using odbc. I think I've installed the unixODBC driver, the odbcinst -j command shows below: But the ini files are empty and R odbc isn't able to connect to the db. Hoping someone can provide some hints on how to troubleshoot this. Thank you in advance.
$ odbcinst -j
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/user/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
unixodbc
or the package maintainers can know what to put in there, asunixodbc.ini
depends on drivers (different packages) you have installed on this system, andodbc.ini
identifies databases specific to your system. Have you installed specific ODBC drivers for any particular DBMS? For example,libsqliteodbc
,msodbcsql17
,odbc-postgresql
,tdsodbc
. – Leaseholderodbc.ini
to finish the job, is that right? – Leaseholderodbc.ini
. You likely just need to start with[somename_does_not_matter]
, thenDriver=ODBC Driver 17 for SQL Server
, thenDatabase=
,Server=
,Port=
per your DBMS. That might be all you need. On the flip side, there is no need to use a system-wideodbc.ini
, you can specify all connection parameters normally found there within yourDBI::dbConnect
directly. (There is utility to the system-wideodbc.ini
, I'm not arguing either way.) – Leaseholder