Hi All,
Hoping someone might have a suggestion - I'm trying to use SQLAlchemy to connect to an MS SQLSERVER database, and I keep getting rejected.
Here's what I'm using to connect:
mssql+pyodbc://myusername:mypassword@servername:serverport/dbname OR
mssql+pyodbc://mydomainname\myusername:mypassword@servername:serverport/dbname
Without the domain name in the username field I get:
sqlalchemy.exc.DBAPIError: (Error) ('28000', "[28000] [Microsoft][ODBC SQL Serve
r Driver][SQL Server]Login failed for user 'myusername'. (18456) (SQLDriverConnect); [
28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'ben
n'. (18456)") None None
On the database server, if I look in the Event Viewer, I find a message that says:
MSSQLSERVER / Event ID: 18456 "Login failed for user 'myusername'. Reason: Could not find a login matching the name provided. "
With the domain name, I get:
sqlalchemy.exc.DBAPIError: (Error) ('28000', "[28000] [Microsoft][ODBC SQL Serve
r Driver][SQL Server]Login failed for user 'mydomainname\\myusername'. (18456) (SQLDrive
rConnect); [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed f
or user 'pathfinder\\BenN'. (18456)") None None
On the database server, if I look in the Event Viewer, I find a message that says:
MSSQLSERVER / Event ID: 18456 "Login failed for user 'pathfinder\myusername'. Reason: Attempting to use an NT account name with SQL Server Authentication. BUT, I confirmed the database server has authentication set to "SQL Server and Windows Authentication mode"
Some other details.
Any suggestions?
:)Ben