sqlcmd not able to find a library (libmsodbcsql-17.0.so.1.1) that is there
I have same problem, this solution worked for me:
you have to downgrade the msodbcsql version,
- apt-get remove msodbcsql
- apt-cache madison msodbcsql
- apt-get install msodbcsql=13.1.9.2-1
- apt-cache madison mssql-tools
- ACCEPT_EULA=Y apt-get install mssql-tools=14.0.6.0-1
- apt-mark hold mssql-tools
- apt-mark hold msodbcsql
I got this solution from this link:
https://github.com/Microsoft/msphpsql/issues/684
Linker errors with libmsodbcsql-13.0.so.0.0 preventing pyODBC to MS SQL connection. CentOS 7
I remember I had this issue too but it was more than one year ago and I don't have access to that server anymore.
As far as I can remember it was a version mismatch. If you see your ldd
output they're looking for libgss.so.3, libcrypto.so.1.0.0, etc. Maybe you have different version of these library installed on your system.
By looking my installation notes it looks like I fixed the issue by creating (soft) links "pointing" the libraries I had on my system. And - of course - I gave these links the names msodbc was looking for. Yes... a little bit "rude" but it worked for me.
Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue?
Running:
odbcinst -j
It yielded:
unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/emehex/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
Instead of copying the files to the /etc/
directory (not sure why unixODBC thought they were there) I created a symbolic link to each file:
sudo ln -s /usr/local/etc/odbcinst.ini /etc/odbcinst.ini
sudo ln -s /usr/local/etc/odbc.ini /etc/odbc.ini
This solved the problem.
Linux python3 - Can't open lib 'SQL Server'
I also recommend you install the ODBC Driver and then try to use pyodbc. I am assuming you are on an Ubuntu 15.04+ machine.
To install the ODBC Driver follow the following instructions:
sudo su
wget https://gallery.technet.microsoft.com/ODBC-Driver-13-for-Ubuntu-b87369f0/file/154097/2/installodbc.sh
sh installodbc.sh
Once you do that, install pyodbc using pip and try the following script:
import pyodbc
server = 'tcp:myserver.database.windows.net'
database = 'mydb'
username = 'myusername'
password = 'mypassword'
cnxn = pyodbc.connect('DRIVER={ODBC Driver 13 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
cursor = cnxn.cursor()
cursor.execute("SELECT @@version;")
row = cursor.fetchone()
while row:
print row
row = cursor.fetchone()
Let me know how that goes.
Cheers,
Meet
Related Topics
Check If a Column Contains Text Using SQL
Add Single Quotes to Results in a Column from a SQL Query
Search Text in Fields in Every Table of a MySQL Database
Finding the Highest Average Salary in SQL
Alternative to Row_Number() to Get Row Position
How to Get Total Count Value Each Day Upto 5 Days
What Is and How to Remove Tablespace Error from My Database
Simple Percentage Calculation in MySQL
How to Convert Nvarchar to Numeric in SQL Server
When to Use Single Quotes, Double Quotes, and Backticks in MySQL
SQL Select Only Rows with Max Value on a Column
How to Return Pivot Table Output in MySQL
Select First Row in Each GROUP BY Group
Simulating group_concat MySQL Function in Microsoft SQL Server 2005
Retrieving the Last Record in Each Group - MySQL
SQL Server Dynamic PIVOT Query
Fetch the Rows Which Have the Max Value for a Column for Each Distinct Value of Another Column