bcpandas
bcpandas copied to clipboard
InterfaceError
I get sqlalchemy.exc.InterfaceError / pyodbc.InterfaceError 28000
the same data config works fine when i used a direct sqlalchemy connection with pandas to_sql, i'm connecting to an specific enviroment (host/enviroment) what could this be? thanks
ps: output is: "sqlalchemy.exc.InterfaceError: (pyodbc.InterfaceError) ('28000', "[28000] [Microsoft] [ODBC 17 for SQL Server][SQL Server] Login failed for user 'USERNAME' (18456) (SQLDriverConnect); [28000] [Microsoft] [ODBC 17 for SQL Server][SQL Server] Login failed for user 'USERNAME'. (18456)"
- user is modified here , but i do connect OK when using sqlmanagmentstudio, sqlalchemy, pandas, and pyodbc.
ok, this reformat worked for me. main.py frome line 95:
#
# construct the engine for sqlalchemy
if odbc_kwargs:
db_url += ";".join(f"{k}={v}" for k, v in odbc_kwargs.items())
conn_string = f"mssql+pyodbc:///?odbc_connect={quote_plus(db_url)}"
# fix STAGE
conn_string = f"mssql+pyodbc://*USER*:*PASSWORD*@*HOST*\\*INSTANCE*/*DATABASE*?driver=ODBC+Driver+17+for+SQL+Server;MARS_Connection=Yes"
self.engine = sa.engine.create_engine(conn_string)
would be great to have full engine config,
I'm not clear - what did you change exactly? And can you post the connection string originally that wasn't working (obviously redact or substitute all sensitive parts)?
Hi! sorry about the delay.
This is what i try and didnt work:
creds = SqlCreds(server="SERVERNAME", database="DB", username="USERNAME", password="PASSWORD") creds = SqlCreds(server="SERVER\INSTANCE", database="DB", port=MYPORT)
i always got "pyodbc.InterfaceError: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server"
something similar as here: https://stackoverflow.com/questions/54098945/pyodbc-interfaceerror
hard-coded solution: the thing is: when i hardcode the full connstring inside main.py it worked.
I dunno if this is still an issue or if its ok to close this one, @yehoshuadimarsky have you test / recreate this issue?
no idea, I do not have a test for this and have not tried recreating it recently