microsoft / microsoft/mssql-python

DOMAIN\user SQL Server login works with pyodbc/FreeTDS but fails with mssql_python

Aperta
#625 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

Nessuno ha ancora preso questa issue.

area: connectivity-auth inADO question triage done
Lingua principale
Python
Stelle
472
Fork
60
Merge medio
2g 11h
PR unite (30g)
36

Descrizione

I am using mssql_python against an on-prem SQL Server using a domain-style username DOMAIN\username but with a password.

The same server, database, username and password work when using pyodbc with the FreeTDS ODBC driver, but fail with mssql_python. The error message is

mssql_python.exceptions.OperationalError: Driver Error: Invalid authorization specification; DDBC Error: [Microsoft][SQL Server]Login failed for user 'DOMAIN\username'.
To reproduce

This code below works:

import pyodbc
s=r"DRIVER=FreeTDS;SERVER=servername;PORT=1433;DATABASE=DM_Database;UID=DOMAIN\username;PWD=J...;TDS_Version=7.4;Encrypt=yes"
conn = pyodbc.connect(_s)

This code below fails with the message reported above:

import mysql_python
s = r"SERVER=servername,1433;Database=DM_Database;UID=DOMAIN\username;PWD=J...;Encrypt=yes;
conn = mssql_python.connect(s)
Further technical details

Python version: 3.10.12
mssql_python: 1.8.0
SQL Server version: SQL Server 2022 (Must be verified, but this is what my documentation says)
Operating system: Ubuntu 22.04.5 LTS

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.