Microsoft odbc driver 17 for sql server tcp provider error code 0x2af9

Hello,

Hello,

I’m trying to setup a ODBC DSN for SQL Server 2012 on Red Hat Linux 6.4. But the connection keeps failing with the following error whenever I try to test the connection using

isql -v [DSN NAME]

I have done the following to configure the DSN

1. Installed ODBC Driver Manager 2.3.0

2. Installed ODBC Driver 11 for Sql server for RHEL 6

3. Updated odbc.ini file in the client installation directory (SAP Business Objects) with the data base server connection parameters.

4. Verified that the Host name, database name and login credentials are correct.

5. Port 1433 on database server is open and listening for tcp connections.

6. Verified that the firewall on linux server is configured to allow connections to the database server.

6. Verified that the database server can be pinged from linux.

Please see the trace file below.

Any assistance is greatly appreciated.

[ODBC][16478][1399208525.871303][__handles.c][459]
        Exit:[SQL_SUCCESS]
            Environment = 0x12d7750
[ODBC][16478][1399208525.871365][SQLAllocHandle.c][375]
        Entry:
            Handle Type = 2
            Input Handle = 0x12d7750
[ODBC][16478][1399208525.871405][SQLAllocHandle.c][493]
        Exit:[SQL_SUCCESS]
            Output Handle = 0x12d8080
[ODBC][16478][1399208525.871447][SQLConnect.c][3654]
        Entry:
            Connection = 0x12d8080
            Server Name = [SQLODBC][length = 7 (SQL_NTS)]
            User Name = [NULL]
            Authentication = [NULL]
        UNICODE Using encoding ASCII ‘ISO8859-1’ and UNICODE ‘UCS-2LE’

        DIAG [08001] [Microsoft][ODBC Driver 11 for SQL Server]TCP Provider: Error code 0x2AF9

        DIAG [08001] [Microsoft][ODBC Driver 11 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.

        DIAG [S1T00] [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired

[ODBC][16478][1399208540.891023][SQLConnect.c][4172]
        Exit:[SQL_ERROR]
[ODBC][16478][1399208540.891070][SQLError.c][434]
        Entry:
            Connection = 0x12d8080
            SQLState = 0x7fff777ee2e0
            Native = 0x7fff777ee2f8
            Message Text = 0x7fff777ee0e0
            Buffer Length = 500
            Text Len Ptr = 0x7fff777ee2fe
[ODBC][16478][1399208540.891121][SQLError.c][471]
        Exit:[SQL_SUCCESS]
            SQLState = S1T00
            Native = 0x7fff777ee2f8 -> 0
            Message Text = [[unixODBC][Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired]
[ODBC][16478][1399208540.891174][SQLError.c][434]
        Entry:
            Connection = 0x12d8080
            SQLState = 0x7fff777ee2e0
            Native = 0x7fff777ee2f8
            Message Text = 0x7fff777ee0e0
            Buffer Length = 500
            Text Len Ptr = 0x7fff777ee2fe
[ODBC][16478][1399208540.891215][SQLError.c][471]
        Exit:[SQL_SUCCESS]
            SQLState = 08001
            Native = 0x7fff777ee2f8 -> 11001
            Message Text = [[unixODBC][Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-specific error has occurred while establishing]
[ODBC][16478][1399208540.891259][SQLError.c][434]
        Entry:
            Connection = 0x12d8080
            SQLState = 0x7fff777ee2e0
            Native = 0x7fff777ee2f8
            Message Text = 0x7fff777ee0e0
            Buffer Length = 500
            Text Len Ptr = 0x7fff777ee2fe
[ODBC][16478][1399208540.891293][SQLError.c][471]
        Exit:[SQL_SUCCESS]
            SQLState = 08001
            Native = 0x7fff777ee2f8 -> 11001
            Message Text = [[unixODBC][Microsoft][ODBC Driver 11 for SQL Server]TCP Provider: Error code 0x2AF9]
[ODBC][16478][1399208540.891327][SQLError.c][434]
        Entry:
            Connection = 0x12d8080
            SQLState = 0x7fff777ee2e0
            Native = 0x7fff777ee2f8
            Message Text = 0x7fff777ee0e0
            Buffer Length = 500
            Text Len Ptr = 0x7fff777ee2fe
[ODBC][16478][1399208540.891354][SQLError.c][471]
        Exit:[SQL_NO_DATA]
[ODBC][16478][1399208540.891382][SQLError.c][514]
        Entry:
            Environment = 0x12d7750
            SQLState = 0x7fff777ee2e0
            Native = 0x7fff777ee2f8
            Message Text = 0x7fff777ee0e0
            Buffer Length = 500
            Text Len Ptr = 0x7fff777ee2fe
[ODBC][16478][1399208540.891408][SQLError.c][551]
        Exit:[SQL_NO_DATA]
[ODBC][16478][1399208540.891450][SQLFreeHandle.c][286]
        Entry:
            Handle Type = 2
            Input Handle = 0x12d8080
[ODBC][16478][1399208540.891485][SQLFreeHandle.c][337]
        Exit:[SQL_SUCCESS]
[ODBC][16478][1399208540.891553][SQLFreeHandle.c][219]
        Entry:
            Handle Type = 1
            Input Handle = 0x12d7750

Regards

Bhanu

The Platform and Software versions I am using are as follows :

Red Hat Enterprise Linux Server release 7.4 (Maipo)
Microsoft SQL Server 2017 (RTM-CU3-GDR) (KB4052987) - 14.0.3015.40 (X64) 
Dec 22 2017 16:13:22 
Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on
Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600:) (Hypervisor)

I have searched a lot for answers on Google but haven’t found any solution yet. I can’t connect to RDS instance having MS SQL instance via Linux.

It shows following errors If I try to :

[ec2-user@ip-~]$ sqlcmd -H mssqldb.xxxxxxxxxxxxxx.com -P 1433
                        -U userXXXXX -P aXXXXXX
                        -Q 'SELECT TOP 1 [n] FROM [dbbase2].[dbo].[table_people]'

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server :
               Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server :
               TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server :
               A network-related or instance-specific error has occurred while
               establishing a connection to SQL Server. The 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.

[ec2-user@ip- ~]$  Check if instance name is correct and if SQL Server is
                   configured to allow remote connections.

Could anyone please tell the issue and resolution ?

Thanks.

C0deDaedalus's user avatar

C0deDaedalus

2,3701 gold badge10 silver badges22 bronze badges

asked Mar 17, 2018 at 8:35

batmanforever's user avatar

8

Check

telnet mssqldb.xxxxxxxxxxxxxx.com 1433 

should open connection to the port.

make sure default instance exists (not named instance) otherwise provide the instance name in the command.

answered May 21, 2018 at 11:00

Omar's user avatar

OmarOmar

192 bronze badges

I spent the last hour trying to connect to a mssql server using sqlcmd through odbc driver.
I was talking to the db guy but he doesn’t seem to have a clue what is going on.. Maybe you can help me out to find some questions I could ask that guy..

I am using the official odbc driver from Microsoft. Aparently we are using some sort of dynamic ports.

There is no firewalls in between.

# odbcinst -q -d -n
[PostgreSQL]
[MySQL]
[ODBC Driver 11 for SQL Server]

I tried it different ways

Error code 0x2AF9:

sqlcmd -S hostnameDEV04 -U username -P password
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 11 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..
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : TCP Provider: Error code 0x2AF9.

and

Error Locating Server/Instance Specified [xFFFFFFFF].

sqlcmd -S hostname\DEV04 -U username -P password
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 11 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..
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. 

Using perl

DBI connect('DASHBOARD','username',...) failed: [unixODBC][Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired (SQL-HYT00) [state was HYT00 now 08001]
[unixODBC][Microsoft][ODBC Driver 11 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. (SQL-08001)
[unixODBC][Microsoft][ODBC Driver 11 for SQL Server]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].  (SQL-08001) at ./test.pl line 4
Can't connect to : [unixODBC][Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired (SQL-HYT00) [state was HYT00 now 08001]
[unixODBC][Microsoft][ODBC Driver 11 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. (SQL-08001)
[unixODBC][Microsoft][ODBC Driver 11 for SQL Server]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].  (SQL-08001) at ./test.pl line 4.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Microsoft ntfs by tuxera ошибка валидации ключа
  • Micromax x1800 ошибка батареи как исправить
  • Micromaster 440 ошибка f0003
  • Mhyprot2 sys is forbidden faceit как исправить
  • Mg5740 ошибка 1403 как сбросить

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии