我正在通过 pyodbc 使用 Windows 身份验证和 Active Directory (AD) 交互模式连接 SQL Server。(出于测试目的)我没有得到任何经过测试的连接字符串来连接数据库。
CONN DETAILS :
server = 'DBSERVER12345\\S123456,1435'
database = 'TESTDB'
username = 'MYNET\\DEV123456' # USER ID B
password = '*******************'
authentication = 'ActiveDirectoryInteractive'
Id
"A" working in windows authentication
conn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';Trusted_Connection=yes')
**"B" Not working with Active directory with interactive mode**
conn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';authentication='+authentication+';UID='+username+';Encrypt=yes;TrustServerCertificate='+ 'yes')
pyodbc==4.0.30
django-mssql-backend==2.8.1 (for Django)
SQL Server 13.0.5