本機Mac的OpenSSL已是3.3.1版了。所以執行sqlcmd報錯如下:
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.
第一個解法,是將/usr/local/opt下的openssl軟連結指向openssl 1.1.1
cd /usr/local/opt
rm -rf openssl
ln -s ../Cellar/openssl@1.1/1.1.1w openssl
第二個解法,不想動到/usr/local/opt的openssl的話,就改環境變數:
export DYLD_LIBRARY_PATH=$(brew --prefix openssl@1.1)/lib:$DYLD_LIBRARY_PATH