SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,067 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am running an airflow DAG in docker, where I connect to sql server 2019 using a pyodbc connection function.
My connection function is as:
def get_db_connection():
return pyodbc.connect(
'DRIVER={ODBC Driver 17 for SQL Server};'
'SERVER=xxx.xxx.x.xx\\XXX2024;'
'DATABASE=somedatabase;'
'UID=username;'
'PWD=password;'
)
When the connection exceeds 15 seconds, I get this error:
return pyodbc.connect( pyodbc.OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
even when setting:
connection.timeout = 30
Can someone help me?