SQLAlchemy connects to SQLServer using Windows Aut

2019-08-01 04:31发布

I can use pymssql to connect to SQLServer using Windows Authentication:

conn = pymssql.connect(host='..', database='..', trusted=True)

But how could I use SQLAlchemy to connect to SQLServer using Windows Authenticaton with pymssql driver?

The example given by SQLAlchemy is:

mssql+pymssql://<username>:<password>@<freetds_name>

Since I use Windows Authentication, I cannot manually set the username and password.

1条回答
时光不老,我们不散
2楼-- · 2019-08-01 05:02

I do not have pymssql to check, but try the version below:

mssql+pymssql://<freetds_name>?trusted=True
查看更多
登录 后发表回答