3

I installed MSSQL per directions here.

/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

When I run my sqlcmd, it get the following output:

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.

I followed the troubleshooting steps here, but I don't really understand the trace output to know if it tells me what the problem is or not. Is someone able to discern what the issue here is and how to resolve it? Thanks!

[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

Environment: MacOS Big Sur v11.6.1 MacBook Pro 2019

0

1 Answer 1

1

ls -al of /usr/local/opt revealed that openssl was linked to openssl@3 instead of [email protected].

rm /usr/local/opt/openssl
ln -s /usr/local/Cellar/[email protected]/1.1.1l_1 /usr/local/opt/openssl

Resolved issue.

Warning: This will break any brew program you may have installed that relies on openssl 3. Wasn't an issue for me, but ymmv.

2
  • Then that is a bug in the brew formula for mssql . Your fix will have broken any brew programs that rely on openssl 3
    – mmmmmm
    Commented Dec 7, 2021 at 17:14
  • @mmmmmm not "my fix", but I see your point. Thanks. It actually came from github.com/microsoft/homebrew-mssql-release/issues/37
    – fbonds66
    Commented Dec 8, 2021 at 22:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .