Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib'

I am trying to get mssql working on my OSX machine. However, it keeps giving me error:

$ sqlcmd -S 0.0.0.0,1401 -U SA -P P@55w0rd -i database-setup/sql/initialize.sql
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found.

Although, I am pretty sure, my file is in that location:

$ ls -la /usr/local/lib/libmsodbcsql.17.dylib
lrwxr-xr-x  1 localadmin  admin  64  7  4 16:38 /usr/local/lib/libmsodbcsql.17.dylib -> /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib

$ ls -la /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib
-r--r--r--  1 localadmin  admin  2539360  7  4 15:34 /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib

I know this question has been asked multiple times but none of the available solutions have worked for me. Things I have tried:

  • https://github.com/Microsoft/homebrew-mssql-release/issues/7
  • https://github.com/Microsoft/homebrew-mssql-release/issues/3
like image 819
d34th4ck3r Avatar asked Jul 30 '18 07:07

d34th4ck3r


1 Answers

I fixed my problem by:

$ brew uninstall msodbcsql17 mssql-tools

and then:

$ brew install msodbcsql17 mssql-tools
like image 144
Ronen Avatar answered Oct 17 '22 01:10

Ronen