Giter VIP home page Giter VIP logo

Comments (5)

mShan0 avatar mShan0 commented on May 26, 2024

It seems like you're using Windows authentication based on the "domain\username" format. Does your machine have permissions to connect to your database?

The issue you linked is not related unless your SQL server is running on a Linux-based machine.

from mssql-django.

dauinsight avatar dauinsight commented on May 26, 2024

If you are using windows authentication, please remove the "USER" and "PASSWORD" field.

from mssql-django.

djl0 avatar djl0 commented on May 26, 2024

@mShan0 @dauinsight Thanks for your replies!

It seems like you're using Windows authentication based on the "domain\username" format. Does your machine have permissions to connect to your database?

I can connect using Pycharm (not in the docker container), so I would think so. The Pycharm connection parameters look pretty basic (ie there aren't any extra flags that I can see, aside from the authentication being "domain credentials").

If you are using windows authentication, please remove the "USER" and "PASSWORD" field.

Then how would I pass the USER & PASSWORD? I took those parameters out, and the message was No Kerberos Credentials Available

Another question: Should the domain in domain\username be domain in the extra parameters string?

Thanks!

from mssql-django.

mShan0 avatar mShan0 commented on May 26, 2024

Your DATABASES should look something like this

DATABASES = {
    "default": {
        "ENGINE": "mssql",
        "NAME": "my_database_name",
        "USER": "DOMAIN\\username", # 2 of "\" to escape the character
        "HOST": "localhost", # or DB's IP address
        "PORT": "1433",
        "OPTIONS": {"driver": "ODBC Driver 18 for SQL Server", 
                    "extra_params": "Trusted_Connection=Yes;"},
    },
}

Did connecting with PyCharm only work when you provided a password?

from mssql-django.

djl0 avatar djl0 commented on May 26, 2024

I tried the database parameters above (though I have ODBD Driver 17 installed), and I still got the same No Kerberos Credentials available error. And I did have to use the password when using Pycharm.

I'm thinking of creating a FreeTDS docker container to give that a try. I believe the server is SQL Server 11 (2012?), would that mean I should use an earlier driver, or would FreeTDS be a better option?

from mssql-django.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.