1

I have configured a new SQL Server 2017.XXX instance in my Windows 10. Then, created a new database called CUSTOMER_DEVICES. I tried to connect to database using pyodbc. I could not and got below error:

Error - pyodbc.OperationalError: ('08001', u'[08001] [Microsoft][ODBC SQL Server Driver]

When I use the same code in existing production server it works. Code below

import pyodbc
conn = pyodbc.connect(r'Driver={SQL Server};Server=localhost;Database=CUSTOMER_DEVICES;Trusted_Connection=yes;')
cursor = conn.cursor()
print(cursor)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Shabnam K
  • 1,572
  • 1
  • 9
  • 10

1 Answers1

1

Check if SQL server Configuration Management is configured. Enable TCP, IP. Check below link Check here

SAMI UL HUDA
  • 171
  • 7