You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DOMAIN\user SQL Server login works with pyodbc/FreeTDS but fails with mssql_python #625
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
For mundane reasons and this particular use-case, the username unfortunately is indeed the name of a domain, a \, and then a "classic" username.
The pyodbc-driver seems to pass the username through.
Activity
github-actions commentedon Jun 4, 2026
Hi Tage-Politi, thank you for opening this issue!
Our team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.
If you have additional information to share, please feel free to update the issue.
Thank you for your patience!
Tage-Politi commentedon Jun 4, 2026
Database confirmeed to be:
sumitmsft commentedon Jul 6, 2026
Hi Tage-Politi Thanks for the report. Since you’re running on Ubuntu 22.04, we want to clarify the authentication mode here.
Since your working comparison uses pyodbc with FreeTDS, this may reflect a driver-specific behavior difference rather than a bug in mssql_python.
Can you confirm whether DOMAIN\username is a SQL login whose literal name includes a backslash?
If it’s the latter, we can investigate further as a compatibility issue.
Tage-Politi commentedon Jul 7, 2026
For mundane reasons and this particular use-case, the username unfortunately is indeed the name of a domain, a
\, and then a "classic" username.The
pyodbc-driver seems to pass the username through.