Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue?

前端 未结 9 1432
无人共我
无人共我 2020-11-27 12:20

When I try to connect to a sql server database with pyodbc (on mac):

import pyodbc

server = \'####\'
database = \'####\'
username = \'####@####\'
password =         


        
9条回答
  •  时光说笑
    2020-11-27 12:46

    Installation that worked on the Ubuntu 18.04. I'm not sure if two of the ./bash_profile and ./bashrc exports are needed but I didn't have time to check.

    sudo apt-get update
    ACCEPT_EULA=Y sudo apt-get -y install msodbcsql17 mssql-tools
    echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile \
    echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc \
    sudo apt-get -y install unixodbc libc6 libstdc++6 libkrb5-3 libcurl3 openssl debconf unixodbc unixodbc-dev
    

    Then as a driver in connection use ODBC Driver 17 for SQL Server which is matching the current Azure version.

提交回复
热议问题