I'm trying to connect to a SQL Server using pyodbc 4.0.30 with Python 3.7. Everything was going great the past couple of days until today when I get this error:
OperationalError: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SSL Security error (18) (SQLDriverConnect); [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (SECCreateCredentials()). (1)')`
My connection:
conn = pyodbc.connect('driver={SQL Server};server=redacted;database=uipcc_awdb;uid=redacted;pwd=redacted;trusted_connection=no;')
Please note I can connect normally to the database via SQL Server Management Studio, and no changes were made on my machine, the SQL Server, or the network.
I need to emphasize, I have tried to following which were mentioned in similar questions (but none worked):
- adding
sslverify=0
in the connection parameters - adding
encrypt=0
in the connection parameters - Changing the OBDC drivers from my machine, didn't work and ruined the connection from SQL Server Management Studio
Driver={ODBC Driver 17 for SQL Server};
in your connection string? Ref: Step 3: Proof of concept connecting to SQL using pyodbc – AlwaysLearning