I'm trying to connect to SQL Server database from my Mac. Here's how I configured my drivers:
--- /etc/freetds/freetds.conf ---
[TS]
host = MISSDBServer01.xxxxxxxx.com
port = 1433
tds version = 7.0
client charset = UTF-8
--- /etc/odbcinst.ini ---
[FreeTDS]
Description = FreeTDS
Driver = /usr/local/lib/libtdsodbc.so
--- /etc/odbc.ini ---
[TS]
Driver = FreeTDS
Server = db.ip.add.ress
ServerName = xxxxAB288
Port = 1433
TDS_Version = 7.0
Everything is fine when I try to connect through tsql
:
tsql -S TS -U user -P pass
locale is "en_GB.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1> select @@version
2> go
Microsoft SQL Server 2012 (SP3) (KB3072779) - 11.0.6020.0 (X64)
Oct 20 2015 15:36:27
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
(1 row affected)
1> exit
But when I tried to connect using isql
, I get this error:
isql -v TS user pass
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
I followed suggestions listed here and here, and as my end goal is to connect to MS SQL Server through R, also tried solutions from here and here.
UPDATE
following @Jim 's suggestion I ran
odbcinst -j
to get the config files directories:unixODBC 2.3.4 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /Users/USERNAME/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8
But when I go to
/etc
folder I can't find them there.. why?When I run
odbcinst -q -d
I getodbcinst: SQLGetPrivateProfileString failed with Unable to find component name.
. I tried to fix it by creating and editing.bash_profile
file, as suggested here, but it made no difference.When I run
odbcinst -q -s
I getodbcinst: SQLGetPrivateProfileString failed with .
but at this point I'm really not sure what to do about it...
I'll appreciate any suggestions how to make it work! thanks!