How do I fix connection error 08001 Python to SQL Server

Viewed 869

I've been trying to connect python with my SQL Server but I get an error and am stuck now. I work on a mac but for this one on a virtual machine with windows 10 installed.

my code:

import pyodbc
pyodbc.drivers()

['SQL Server', 'SQL Server Native Client 11.0', 'SQL Server Native Client RDA 11.0', 'ODBC Driver 17 for SQL Server']

conn = pyodbc.connect("Driver={ODBC Driver 17 for SQL Server};" 
                    "Server=HEPHAISTEONAE5E/FUHRP;"
                    "Database=Fuhrp;"
                    "Trusted_Connected=yes;"
                   )

my error is:

---------------------------------------------------------------------------
OperationalError                          Traceback (most recent call last)
<ipython-input-18-b79b6302679d> in <module>
----> 1 conn = pyodbc.connect("Driver={ODBC Driver 17 for SQL Server};" 
      2                     "Server=HEPHAISTEONAE5E/FUHRP;"
      3                     "Database=Fuhrp;"
      4                     "Trusted_Connected=yes;"
      5                    )

OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [67].  (67) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute (0); [08001] [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (67)')

My SQL Server allows remote connections, already checked that.

Hope someone can help me out here. Thanks! :)

0 Answers
Related