1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] OperationalError when trying to connect to SQL Server database using pyodbc

Discussão em 'Python' iniciado por Stack, Setembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to connect to a SQL server database using pyodbc in Python 3. But I get an error when I'm trying to establish the connection.

    I do something like this:

    import pyodbc
    conn = pyodbc.connect('Driver={ODBC Driver 18 for SQL Server};Server=192.168.2.250;Database=DB;UID=username;PWD=password;')


    And I get this:

    OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol][error:140B40C7:SSL routines:SSL_do_handshake:peer did not return a certificate] (-1) (SQLDriverConnect)')


    Does anybody know how to solve this? The database is not my own, so I hope there is a solution that doesn't require changing any settings there.

    I'm running Ubuntu within the Windows Subsystem for Linux.

    Continue reading...

Compartilhe esta Página