I am trying to connect to my database on MS SQL Server 2016 using pyodbc via the below python script from my laptop (on Windows 10) and planning to have the code deployed in a Linux RHEL 6.4 server.
conn=pyodbc.connect('Driver={SQL Server};'
'Server=DB_Instance;'
'Database=DB_Name;'
'UID=user_name;'
'PWD=password;'
'Trusted_Connection=no;');
At my laptop, SQL Server (version: 10.00.17763.01) and SQL Server Native Client 11.0 (version: 2011.110.7493.04) are already available.
While executing the python script from my laptop, I am getting the below error message.
pyodbc.operationalError: ('08001', '[08001] [Microsoft] [ODBC SQL Server Driver][DBNETLIB]SSL Security error (18) (SQLDriverConnect); [08001] [Microsoft] [ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (SECDoClientHandshake()). (772)')
As per the organization standard, TLS 1.0 is disabled on the windows server where the SQL Server is installed in the network. Since I am accessing the database via python script, we cannot temporarily enable TLS 1.0. I am looking for a direction. Any help is greatly appreciated!!
conn=pyodbc.connect('Driver={ODBC Driver 17 for SQL Server};' 'Server=DB_Instance,port;' 'Database=DB_Name;' 'UID=user_name;' 'PWD=password;' 'Trusted_Connection=no;');
– Guna