Getting different error messages trying to connect to DB server.

351 views
Skip to first unread message

Ben Nardone

unread,
Dec 19, 2014, 3:31:28 PM12/19/14
to sqlal...@googlegroups.com
 
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.
I've confirmed the SQL Server (SQL Server 2008 R2) is set to be available by IP and that there is a firewall exception for the port (per http://stackoverflow.com/questions/12097570/sql-server-express-2008-configure-for-remote-access-via-url).
I'm running Python 2.7, and pyodbc-3.0.7.win-amd64-py2.7.exe.

Any suggestions?  


:)Ben

 

Michael Bayer

unread,
Dec 19, 2014, 7:06:37 PM12/19/14
to sqlal...@googlegroups.com
more of a pyodbc issue / ODBC configuration issue.    you probably want to try pyodbc directly, though that might take awhile, so maybe stackoverflow.

you probably want to start with ODBC connect tools, e.g. those “test connection” buttons you see when you set up your ODBC datasource (assuming this is connecting from windows).    

Ben Nardone <benjami...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages