1. Baixe o Microsofy ODBC DRIVER 17 PARA SQL SERVER
Ubuntu 14.04, 16.04, 17.10 e 18.04
Copiar
sudo sucurl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -#Download appropriate package for the OS version#Choose only ONE of the following, corresponding to your OS version#Ubuntu 14.04curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list > /etc/apt/sources.list.d/mssql-release.list#Ubuntu 16.04curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list#Ubuntu 18.04curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list#Ubuntu 18.10curl https://packages.microsoft.com/config/ubuntu/18.10/prod.list > /etc/apt/sources.list.d/mssql-release.listexitsudo apt-get updatesudo ACCEPT_EULA=Y apt-get install msodbcsql17# optional: for bcp and sqlcmdsudo ACCEPT_EULA=Y apt-get install mssql-toolsecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profileecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrcsource ~/.bashrc# optional: for unixODBC development headerssudo apt-get install unixodbc-dev
Instalando via pip o pyodbc
pip install pyodbc
Exemplo
import pyodbc
# Some other example server values are
# server = 'localhost\sqlexpress' # for a named instance
# server = 'myserver,port' # to specify an alternate port
server = 'server_dns,2127'
database = 'banco'
username = 'nome_do_usuario'
password = 'senha_do_usuario'
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
cursor = cnxn.cursor()
cursor.execute("SELECT top 10* FROM tabela")
tables = cursor.fetchall()
for row in tables:
print(row)
Este artigo foi útil ?
SimNão
Last modified: 8 de julho de 2019
Need that ICG Bet login sorted out? It can be a pain sometimes! Hopefully, icgbetlogin makes it easy for you. Get in, place your bets, and have some fun!
Demopgslot é top pra quem quer treinar antes de apostar de verdade! Dá pra testar os jogos sem gastar nada. Ótima dica pra iniciantes! demopgslot
Ta28bet is where it’s at! Good odds, and easy to place bets. Been having some good luck lately. Jump in on the action: ta28bet
Yo, up786game is kinda cool! The graphics are better than I expected, and I appreciate the various options they offer. It’s not perfect, but it’s solid. Check it out for yourself here: up786game.
Been checking out bonos777bet lately, mainly for the bonuses. They’re pretty good, definitely worth keeping an eye on. Check it: bonos777bet
Been looking for the safest place to grab the latest 188bet app. Found 188betappdownload. Has anybody used this site before? Tell me your experiences or go check them out at 188betappdownload.