sarathsshanker 0 Newbie Poster

While trying to connect to MSSQL Server 2012 using pymssql,I get the following error.

My server name in Windows Authentication is SARATH,User Name is Sarath\SarathShanker and I did not set a password.

>>> mssql_conn=pymssql.connect(host='SARATH',user='Sarath\SarathShanker',password='',database='matrix')

Error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pymssql.pyx", line 556, in pymssql.connect (pymssql.c:7990)

pymssql.OperationalError: (18452, 'Login failed. The login is from an untrusted
domain and cannot be used with Windows authentication.DB-Lib error message 18452
, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB
-Lib error message 20002, severity 9:\nAdaptive Server connection failed\nDB-Lib
error message 18452, severity 14:\nGeneral SQL Server error: Check messages fro
m the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server conne
ction failed\n')

Now,How should I modify my script in order to connect to MSSQL Server using pymssql.

P.S I have alreadt imported pymssql as well.(Not Shown in Code above)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.