Skip to content

Error [HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired  #110

@legioz

Description

@legioz

image

'HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)'

I am getting the error above, I am using Django 3.0.5 with django-mssql-backend 2.8.1

My config on settings.py is:

DATABASES = {

   'default': {
       'ENGINE': 'django.db.backends.mysql',
       'NAME': config('MYSQL_DEFAULT_DB'),
       'USER': config('MYSQL_DEFAULT_USER'),
       'PASSWORD': config('MYSQL_DEFAULT_PASS'),
       'HOST': config('MYSQL_DEFAULT_HOST'),
       'PORT': config('MYSQL_DEFAULT_PORT'),
       'OPTIONS': {
           'init_command': "SET sql_mode='NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO'"
       },
   },

     'db2': {
       'ENGINE': 'sql_server.pyodbc',
       'NAME': config('DB2_DB'),
       'HOST': config('DB2_SERVER'),
       'PORT': config('DB2_PORT'),
       'USER': config('DB2_USER'),
       'PASSWORD': config('DB2_PASS'),
       'OPTIONS': {
           'driver': 'ODBC Driver 17 for SQL Server',
       },
   },
.
.
.

The port DB2_PORT variable cannot be an empty string.

All variables are beeing passed correctly and I can connect directly to DB2 using others MSSQL clients

[

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions