突然间我无法连接到SQL Azure数据库

时间:2016-01-27 21:51:37

标签: javascript node.js azure-sql-database sequelize.js

我已成功使用Sequelize连接到我在Azure上托管的网站的SQL Server数据库几个月了。直到今天一切都很好。今天我输入时:node server.js我收到此错误:

Unhandled rejection SequelizeConnectionError: Login failed for user 'EventAdmin'.
    at Connection.<anonymous> (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:103:16)
    at emitOne (events.js:77:13)
    at Connection.emit (events.js:169:7)
    at Connection.processLogin7Response (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\lib\connection.js:712:16)
    at Connection.message (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\lib\connection.js:1120:21)
    at Connection.dispatchEvent (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\lib\connection.js:559:45)
    at MessageIO.<anonymous> (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\lib\connection.js:479:23)
    at emitNone (events.js:67:13)
    at MessageIO.emit (events.js:166:7)
    at ReadablePacketStream.<anonymous> (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\lib\message-io.js:103:15)
    at emitOne (events.js:77:13)
    at ReadablePacketStream.emit (events.js:169:7)
    at readableAddChunk (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_readable.js:201:16)
    at ReadablePacketStream.Readable.push (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_readable.js:165:10)
    at ReadablePacketStream.Transform.push (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_transform.js:133:32)
    at ReadablePacketStream._transform (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\lib\message-io.js:68:16)
    at ReadablePacketStream.Transform._read (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_transform.js:172:10)
    at ReadablePacketStream.Transform._write (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_transform.js:160:12)
    at doWrite (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_writable.js:335:12)
    at writeOrBuffer (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_writable.js:321:5)
    at ReadablePacketStream.Writable.write (C:\Users\v-mibowe\Documents\repositories\event-site\node_modules\tedious\node_modules\readable-stream\lib\_stream_writable.js:248:11)
    at CleartextStream.ondata (_stream_readable.js:528:20)

我确定所有的登录信息都是正确的,因为它昨天正常工作,并且该网站仍使用相同的登录信息在线。我用这个连接到数据库:

var sql = new Sql(process.env.DB_NAME, process.env.DB_USER, process.env.DB_PASS, {
  host: process.env.DB_HOST,
  dialect: 'mssql',
  pool: {
    max: 5,
    min: 0,
    idle: 10000
  },
  dialectOptions: {
    encrypt: true
  }
});

我尝试过rm -rf node_modules然后npm cache clearnpm install,但它没有任何区别。我也尝试使用不同的计算机,但它有同样的问题。我也使用Azure并重置密码以确保密码正确,但它没有效果。

如果有更多信息有帮助,请与我们联系。您可以在my GitHub Repo上看到完整的项目。谢谢,如果你提供所有帮助,请致谢!

好的,所以它随机开始工作,但是当我重新启动服务器(没有改变任何东西)之后,登录又开始失败了。问题是,我没有改变任何东西,所以我不知道该怎么做才能修复它......

更令人讨厌的是,它第二天又开始工作了,但现在又失败了。如果您需要更多信息,请告诉我,非常感谢您的帮助!

0 个答案:

没有答案