NodeJS: How to connect to MSQL database using Windows Authentication/trustedConnection from Mac

1.9k views Asked by At

I'm building a NodeJS app on my Mac and I need to connect to a MSSQL database.

Using the node module mssql, I'm able to connect to the server. But authentication fails because the database server requires the use of Windows Authorization or 'trustedConnection'. If I could use the Microsoft Driver for Node.js for SQL Server with mssql, I could provide a true value for 'options.trustedConnection', but that driver is Windows only.

Is there any way to do what I'm attempting? I don't see a way with the other drivers/node modules (tedious, tds, etc) to provide a connection string that would set trustedConnection to true or use Windows Authentication.

1

There are 1 answers

1
Russj On BEST ANSWER

I just successfully connected to the SQL Server from Ubuntu 14.04.

I use FreeTDS as the driver, and unxiODBC as the driver manager, node odbc as the Node.js module to connect. I think this might be used on OSX as well.

More information can see this link. I blog it, and hope can save someone else's time.

But I need to do more research because I want to use this node module mssql to connect. mssql uses tds or tedious as drivers.