3 votos

sqlcmd no encuentra odbc 17 en MacOS Big Sur

He instalado MSSQL según las instrucciones aquí .

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools
sudo ln -s /usr/local/etc/odbcinst.ini /etc/odbcinst.ini
sudo ln -s /usr/local/etc/odbc.ini /etc/odbc.ini

Cuando ejecuto mi sqlcmd, obtiene la siguiente salida:

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed].
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.

He seguido los pasos para solucionar el problema aquí Pero no entiendo bien la salida de la traza para saber si me dice cuál es el problema o no. ¿Alguien puede discernir cuál es el problema aquí y cómo resolverlo? Gracias.

[ODBC][91830][1638890399.677549][__handles.c][460]
        Exit:[SQL_SUCCESS]
            Environment = 0x7fb388023000
[ODBC][91830][1638890399.677704][SQLSetEnvAttr.c][189]
        Entry:
            Environment = 0x7fb388023000
            Attribute = SQL_ATTR_ODBC_VERSION
            Value = 0x3
            StrLen = 0
[ODBC][91830][1638890399.677916][SQLSetEnvAttr.c][381]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.677988][SQLAllocHandle.c][377]
        Entry:
            Handle Type = 2
            Input Handle = 0x7fb388023000
        UNICODE Using encoding ASCII 'US-ASCII' and UNICODE 'UCS-2-INTERNAL'

[ODBC][91830][1638890399.678164][SQLAllocHandle.c][513]
        Exit:[SQL_SUCCESS]
            Output Handle = 0x7fb390817800
[ODBC][91830][1638890399.678262][SQLSetConnectAttr.c][399]
        Entry:
            Connection = 0x7fb390817800
            Attribute = SQL_ATTR_LOGIN_TIMEOUT
            Value = 0x8
            StrLen = 4
[ODBC][91830][1638890399.678328][SQLSetConnectAttr.c][691]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.678406][SQLSetConnectAttrW.c][335]
        Entry:
            Connection = 0x7fb390817800
            Attribute = SQL_ATTR_PACKET_SIZE
            Value = 0x1000
            StrLen = 4
[ODBC][91830][1638890399.678483][SQLSetConnectAttrW.c][627]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.678601][SQLDriverConnectW.c][290]
        Entry:
            Connection = 0x7fb390817800
            Window Hdl = 0x0
            Str In = [DRIVER={ODBC Driver 17 for SQL Server};SERVER={gsat-ihealth-fb.database.windows.net};Database={master};UID={ihealth-fbadmin};PW...][length = 180 (SQL_NTS)]
            Str Out = 0x0
            Str Out Max = 0
            Str Out Ptr = 0x0
            Completion = 0
[ODBC][91830][1638890399.834073][__handles.c][460]
        Exit:[SQL_SUCCESS]
            Environment = 0x7fb39081f000
[ODBC][91830][1638890399.834252][SQLGetEnvAttr.c][157]
        Entry:
            Environment = 0x7fb39081f000
            Attribute = 65002
            Value = 0x7000054b5190
            Buffer Len = 128
            StrLen = 0x7000054b5174
[ODBC][91830][1638890399.834791][SQLGetEnvAttr.c][273]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.834949][SQLFreeHandle.c][220]
        Entry:
            Handle Type = 1
            Input Handle = 0x7fb39081f000
[ODBC][91830][1638890399.835183][SQLDriverConnectW.c][699]
        Exit:[SQL_ERROR]
[ODBC][91830][1638890399.835364][SQLGetDiagFieldW.c][892]
        Entry:
            Connection = 0x7fb390817800
            Rec Number = 0
            Diag Ident = 2
            Diag Info Ptr = 0x7ffeee9c43e2
            Buffer Length = 2
            String Len Ptr = 0x0
[ODBC][91830][1638890399.835467][SQLGetDiagFieldW.c][924]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.835650][SQLGetDiagFieldW.c][892]
        Entry:
            Connection = 0x7fb390817800
            Rec Number = 1
            Diag Ident = 5
            Diag Info Ptr = 0x7ffeee9c43dc
            Buffer Length = -6
            String Len Ptr = 0x0
[ODBC][91830][1638890399.835760][SQLGetDiagFieldW.c][924]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.835846][SQLGetDiagFieldW.c][892]
        Entry:
            Connection = 0x7fb390817800
            Rec Number = 1
            Diag Ident = 6
            Diag Info Ptr = 0x7fb39081ce00
            Buffer Length = 2050
            String Len Ptr = 0x7ffeee9c43e0
[ODBC][91830][1638890399.835918][SQLGetDiagFieldW.c][924]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.836011][SQLGetDiagFieldW.c][892]
        Entry:
            Connection = 0x7fb390817800
            Rec Number = 1
            Diag Ident = 4
            Diag Info Ptr = 0x7ffeee9c43e4
            Buffer Length = 12
            String Len Ptr = 0x7ffeee9c43e0
[ODBC][91830][1638890399.836084][SQLGetDiagFieldW.c][924]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.836246][SQLGetDiagFieldW.c][892]
        Entry:
            Connection = 0x7fb390817800
            Rec Number = 2
            Diag Ident = 5
            Diag Info Ptr = 0x7ffeee9c43dc
            Buffer Length = -6
            String Len Ptr = 0x0
[ODBC][91830][1638890399.836314][SQLGetDiagFieldW.c][924]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.836506][SQLGetDiagFieldW.c][892]
        Entry:
            Connection = 0x7fb390817800
            Rec Number = 2
            Diag Ident = 6
            Diag Info Ptr = 0x7fb39081ce00
            Buffer Length = 2050
            String Len Ptr = 0x7ffeee9c43e0
[ODBC][91830][1638890399.836586][SQLGetDiagFieldW.c][924]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.836774][SQLGetDiagFieldW.c][892]
        Entry:
            Connection = 0x7fb390817800
            Rec Number = 2
            Diag Ident = 4
            Diag Info Ptr = 0x7ffeee9c43e4
            Buffer Length = 12
            String Len Ptr = 0x7ffeee9c43e0
[ODBC][91830][1638890399.836904][SQLGetDiagFieldW.c][924]
        Exit:[SQL_SUCCESS]
[ODBC][91830][1638890399.837152][SQLGetConnectAttrW.c][211]Error: SQL_INVALID_HANDLE

Entorno: MacOS Big Sur v11.6.1 MacBook Pro 2019

1voto

fbonds66 Puntos 113

Ls -al de /usr/local/opt reveló que openssl estaba vinculado a openssl@3 en lugar de openssl@1.1.

rm /usr/local/opt/openssl
ln -s /usr/local/Cellar/openssl@1.1/1.1.1l_1 /usr/local/opt/openssl

Problema resuelto.

Advertencia: Esto romperá cualquier programa de brebaje que pueda tener instalado que dependa de openssl 3. No fue un problema para mí, pero ymmv.

0 votos

Entonces eso es un error en la fórmula brew para mssql . Su arreglo habrá roto cualquier programa brew que dependa de openssl 3

0 votos

@mmmmmm no es "mi arreglo", pero veo tu punto de vista. Gracias. En realidad viene de github.com/microsoft/homebrew-mssql-release/issues/37

AppleAyuda.com

AppleAyuda es una comunidad de usuarios de los productos de Apple en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X