0

From an Ubuntu 20.x machine, using this program to connect to a SQL Server machine under Windows 2019 Sever:

import pyodbc
from sqlalchemy import create_engine

if __name__ == "__main__":
    print(pyodbc.drivers())
    
    constr = 'mssql+pyodbc://domain_name\uname:pwd@xxx.xx.xx.xx:1433/db?Trusted_Connection=yes&driver=ODBC Driver 17 for SQL Server'

    engine = create_engine(constr)
    connection = engine.connect()

I get this exception:

sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('HY000', '[HY000] [Microsoft][ODBC Driver 17 for SQL Server]SSPI Provider: No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000) (851968) (SQLDriverConnect)') (Background on this error at: https://sqlalche.me/e/14/dbapi)

This is a single machine. There is no Active Directory or Kerberos, etc.

Ivan
  • 7,448
  • 14
  • 69
  • 134
  • `domain_name\uname:pwd` looks like you're trying to use Windows Authentication credentials. Try using SQL Login credentials instead. – AlwaysLearning Aug 28 '21 at 06:10
  • I don't want to use SQL Login - I need Windows Login. I realize that it seems that I am mixing Windows Login with SQL Login, but what is the correct way to Login from a Linux machine when you don't have Kerberors etc? – Ivan Aug 28 '21 at 20:20

0 Answers0