tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.23k stars 467 forks source link

Login failed for user ''. on v9.1.0 #1460

Closed aterna01 closed 1 year ago

aterna01 commented 1 year ago

Can not connect to SQL server

Expected behaviour:

Successfully connect to SQL server

Connect to SQL and successfully run queries

Actual behaviour:

Get an error when trying to connect to SQL. This happens on the latest v9.1.0 but works fine on v9.0.1

This is the function which is called to connect to SQL

async function getSqlServerDriver() { const pool = new sql.ConnectionPool(config.sql.connectionString); await pool.connect(); return pool; }

The error is

Login failed for user ''.
      at Object.onceWrapper (node:events:628:26)
      at Connection.emit (node:events:513:28)
      at Connection.emit (node:domain:489:12)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

Configuration:

// paste relevant config here
config.sql.connectionString = "Server=x.x.x.x;Database=someDb;User Id=someUser;Password=somePass;trustServerCertificate=true;request timeout=30000"

Software versions

heikkilamarko commented 1 year ago

We faced this same problem after updating from v9.0.1 to v9.1.0.

dhensby commented 1 year ago

I'll investigate, thanks for reporting

dhensby commented 1 year ago

This regression was fixed in 9.1.1