I'm on Ubuntu 16.04 trying to use sqlcmd
launched programmatically from a script to do a SQL query in the VM's cloud.
vm-dev:~$ sudo sqlcmd -S my-db.url.net -d my-db
I keep getting this error:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.0.so.1.1' : file not found.
But the file is clearly there:
vm-dev:~$ ls /opt/microsoft/msodbcsql17/lib64/
libmsodbcsql-17.0.so.1.1
I have same problem, this solution worked for me: you have to downgrade the msodbcsql version,
I got this solution from this link:
https://github.com/Microsoft/msphpsql/issues/684
Just for those who are experiencing the same issue on Ubuntu 18.04 and came here but didn't have the issue solved by the accepted answer, since it's targeted to Ubuntu 16.04, sharing another possible solution, tested with an Ubuntu 18.04 docker container for a Python 3.6 application which relies on Microsoft's odbc driver.
Step 1: Check Library Dependencies
Check if all library dependencies are satisfied using the command ldd. On my environment, the missing libraries were libssl1.0.0 and libgssapi-krb5-2. Below, an example of the command and its output with a missing dependency, grep the output for not found
if you will.
$ ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1
libfoo.so => /path/to/lib/foo/libfoo.so
libbar.so => /path/to/lib/bar/libbar.so
libbaz.so => not found
Step 2: Check Who Provides the Missing Dependency
Check which package provides the missing dependency using dpkg search.
$ dpkg -S libbaz.so
libbaz:amd64: /usr/lib/x86_64-linux-gnu/libbaz.so.1.2.3,
Step 3: Install Missing Dependency
$ sudo apt install libbaz
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With