0

I'm trying to connect to a Microsoft Azure SQL database that works just fine when using SQL Server Studio. However, when trying out the same thing in Python, the following code returns this error:

import pymssql

connection = pymssql.connect(server="d9i4er2rxb.database.windows.net",
      user="USER@d9i4er2rxb", password="Knastivas78", database="pb")

>>> (20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server 
connection failed (d9i4er2rxb.database.windows.net:1433)\n')

(P.S - the server, user, password info is edited and won't work if you run the code, for company secrecy reasons)

How do I troubleshoot this issue?

Daniel Slätt
  • 751
  • 2
  • 15
  • 28
  • Possible duplicate of [Adaptive server connection failed (DB-Lib error message 20002, severity 9)](https://stackoverflow.com/questions/40991190/adaptive-server-connection-failed-db-lib-error-message-20002-severity-9) – Mike Scotty Nov 20 '18 at 14:37
  • It is a duplicate, however none of the alternative solutions presented in that thread form a working solution. – Daniel Slätt Nov 20 '18 at 14:53

0 Answers0