Closed altintashalitmert closed 2 years ago
I had the same problem and nothing in https://github.com/mkleehammer/pyodbc/issues/967 worked. I ended with setting this environment variable when launching my script:
DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/openssl@1.1/1.1.1l_1/lib/: $DYLD_LIBRARY_PATH
and now it works.
I had the same problem and nothing in #967 worked. I ended with setting this environment variable when launching my script:
DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/openssl@1.1/1.1.1l_1/lib/: $DYLD_LIBRARY_PATH
and now it works.
how can i do it?
@altintashalitmert Either set it using os.environ inside Python before you import pyodbc or set it for example in your IDE before running your code. If you are using PyCharm: https://stackoverflow.com/questions/42708389/how-to-set-environment-variables-in-pycharm
@v-chojas and @david-engel
via isql
which openssl
openssl version
Error:
Here is the full set of errors I m currently greeted with, please help me establish a connection. thank you! FYI - I m just getting started with these technologies :)
That one does not appear to be OpenSSL-related. Timeout error is usually because you are not connecting to the right server, or it's not listening, or a firewall is in the way. In any case, it is a networking issue.
@v-chojas this works with no errors on a windows machine :(
same code, same service accts, same hostname and db.
I use a mac (Catalina)
Are you able to at least ping the server from the machine you're getting the connection errors? Does the server have a firewall that is not allowing the connection?
I can ping the server and get the following output:
I copied only a portion of it to hide the server name and stuff, thanks @v-chojas
@v-chojas and David-Engel
I get the correct error now (All I did is remove the '<>' from my connection string.
Thank you!
Now you can go to https://github.com/microsoft/homebrew-mssql-release/issues/59 to apply the workaround.
ln -s /usr/local/Cellar/openssl@1.1/1.1.1l /usr/local/opt/openssl
@v-chojas this you mean? Sorry!
@v-chojas - I tried to do the above (running the 'ln -s /usr/local/Cellar/openssl@1.1/1.1.1l /usr/local/opt/openssl'
and did 'rm /usr/local/opt/openssl'
I still get the same error:
Don't mix OpenSSL versions. /usr/local/opt/openssl is the right one.
Okay @v-chojas . sorry about the confusion, I still get the same library not loaded error :(
@v-chojas - Success (please find the screenshot below):
Solution for above:
but I get the same error using my python script:
@v-chojas - I am all set, just restarted my machine and i can connect now. Thank you both (you and @David-Engel)
Solution: ln -s /usr/local/Cellar/openssl@1.1/1.1.1l/m /usr/local/opt/openssl
@dragnblow does this if you are on linux machine we have to confirm what SSL version it's using to connect to SQL 2019 server?
Environment
Issue
Hi, when I try to connect to SQL Server, this error is thrown: '08001', '[08001] [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection (0) (SQLDriverConnect)', i have readed this issue https://github.com/mkleehammer/pyodbc/issues/967 and move to openssl the location but still can't connect to server.
ls -l /usr/local/opt/openssl/lib :
ls -l /usr/local/opt/openssl@1.1/lib :