2

I m operating on Windows Server 2008 and I want to connect my application to a local SQL Server database .

I have read this: https://codedark.xyz/blog/connecting-to-ms-sql-server-with-knex

I have enabled TCP/IP connections to the server as well as default port 1433 for SQL Server. I then restarted the server instance.

I'm trying to connect with Windows authentication and my connection string looks like this :

mssql: {
client : "mssql",
connection: {
  server : "localhost",
  user : "windowsusername",
  password : "windowspassword",
  options: {
    port: 1433,
    database : "mydb",
    encrypt: true
  }
},
}

I get this error :

Login failed for user 'windowsuser'

My question: is it possible to connect to a local SQL Server database using Windows authentication? And if yes, which are the right credentials?

1 Answer 1

0

If you wish to use windows authentication, which I would recommend, then remove the user and password information and try this:

Integrated Security: "SSPI"

Depending on your set up, using windows auth could prove difficult unless you can specify the connection string as an actual string and not an object.

See this question for additional information Stack Reference

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.