Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database error conection using django-pyodbc to connect to SQL Server 2019 #172

Open
tejas7777 opened this issue May 13, 2021 · 1 comment

Comments

@tejas7777
Copy link

I get the following error when I try to connect to MS SQl 2019 from my Django app using django-pyodbc

('08001', '[08001] [Microsoft][SQL Server Native Client 11.0]TCP Provider: No connection could be made because the target machine actively refused it. (10061) (SQLDriverConnect); [08001] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0); [08001] [Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute (0); [08001] [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (10061)')

How do I proceed?

@RossRogers
Copy link
Contributor

Hi @tejas7777 ,

django-pyodbc is built on top of pyodbc It sounds like you aren't able to get pyodbc to talk to your with your MS SQL server yet. Work through the pyodbc docs to sort that out and you'll be on your way. Once you something like the following working, you'll be ready to start using django-pyodbc:

python -c 'import pyodbc; print(pyodbc.connect("DSN=foobar_mssql_data_source_name;UID=foo;PWD=bar").cursor().execute("select 1"))'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants