简体   繁体   English

ConnectionError [SequelizeConnectionError]:无法连接到:1433 - 无法连接(序列)本地机器 window 10

[英]ConnectionError [SequelizeConnectionError]: Failed to connect to :1433 - Could not connect (sequence) local machine window 10

***** mssql db connected sucessfully **** customers (node:116) [DEP0118] DeprecationWarning: The provided hostname "" is not a valid hostname, and is supported in the dns module solely for compatibility. ***** mssql db 连接成功 **** 客户 (node:116) [DEP0118] DeprecationWarning: 提供的主机名“”不是有效的主机名,仅出于兼容性考虑,dns 模块支持。 (Use node --trace-deprecation... to show where the warning was created) ConnectionError [SequelizeConnectionError]: Failed to connect to:1433 - Could not connect (sequence) at ConnectionManager.connect (H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\mssql\connection-manager.js:139:17) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async ConnectionManager._connect (H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:318:24) at async H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:250:32 (使用node --trace-deprecation...显示警告的创建位置) ConnectionError [SequelizeConnectionError]: Failed to connect to:1433 - 无法在 ConnectionManager.connect 连接(序列)(H:\codeoptimalsolutions\socialApp\backend \node_modules\sequelize\lib\dialects\mssql\connection-manager.js:139:17) 在 processTicksAndRejections (internal/process/task_queues.js:93:5) at async ConnectionManager._connect (H:\codeoptimalsolutions\socialApp\backend \node_modules\sequelize\lib\dialects\abstract\connection-manager.js:318:24) 在异步 H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:250: 32
at async ConnectionManager.getConnection (H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:280:7) at async H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\sequelize.js:613:26 at async MSSqlQueryInterface.select (H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\abstract\query-interface.js:953:12) at async Function.findAll (H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\model.js:1753:21) { parent: ConnectionError: Failed to connect to:1433 - Could not connect (sequence) at ConnectionError (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\errors.js:13:12) at Connection.socketError (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connection.js:1641:56)在异步 ConnectionManager.getConnection (H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:280:7) 在异步 H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\ lib\sequelize.js:613:26 在异步 MSSqlQueryInterface.select (H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\dialects\abstract\query-interface.js:953:12) 在异步 Z86408593C34AF757FDD.findAllF29 H:\codeoptimalsolutions\socialApp\backend\node_modules\sequelize\lib\model.js:1753:21) { 父级:ConnectionError:无法连接到:1433 - 无法在 ConnectionError 处连接(序列)(H:\codeoptimalsolutions\socialApp \backend\node_modules\tedious\lib\errors.js:13:12) 在 Connection.socketError (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connection.js:1641:56)
at H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connection.js:1400:21 at SequentialConnectionStrategy.connect (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:129:14) at H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:201:80 at processTicksAndRejections (internal/process/task_queues.js:80:21) { code: 'ESOCKET' }, original: ConnectionError: Failed to connect to:1433 - Could not connect (sequence) at ConnectionError (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\errors.js:13:12) at Connection.socketError (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connection.js:1641:56)在 H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connection.js:1400:21 在 SequentialConnectionStrategy.connect (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:129:14 ) 在 H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:201:80 在 processTicksAndRejections (internal/process/task_queues.js:80:21) { code: 'ESOCKET' }, original: ConnectionError :无法连接到:1433 - 在 Connection.socketError (H:\codeoptimalsolutions\ socialApp\backend\node_modules\tedious\lib\connection.js:1641:56)
at H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connection.js:1400:21 at SequentialConnectionStrategy.connect (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:129:14) at H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:201:80 at processTicksAndRejections (internal/process/task_queues.js:80:21) { code: 'ESOCKET' } }在 H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connection.js:1400:21 在 SequentialConnectionStrategy.connect (H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:129:14 ) 在 H:\codeoptimalsolutions\socialApp\backend\node_modules\tedious\lib\connector.js:201:80 在 processTicksAndRejections (internal/process/task_queues.js:80:21) { code: 'ESOCKET' } }

I tried我试过了

  1. TCP/IP is enabled TCP/IP 已启用

  2. checked some answers ntng found all give me advice to enable TCP/IP检查了一些答案 ntng 发现都给了我启用 TCP/IP 的建议

    var sequelize = new Sequelize(DBNAME,USERNAME,PASSWORD,{ dialect: 'mssql', host: hostname, port: 1433, logging: false, dialectOptions: { requestTimeout: 30000, encrypt: true } })

When i try to run get query then got this error当我尝试运行获取查询时出现此错误

        Models.Customer.findAll({}, {}, {}).then(data=>{   
                      console.log(data);
          }).catch(err => { //console.log("err",err);
                      console.log(err);
          });

Bit of a stab in the dark because I don't feel there's enough information but the error states DeprecationWarning: The provided hostname "" is not a valid hostname, and is supported in the dns module solely for compatibility.在黑暗中有点刺,因为我觉得没有足够的信息,但错误状态DeprecationWarning: The provided hostname "" is not a valid hostname, and is supported in the dns module solely for compatibility. Followed by a number of connection errors.其次是一些连接错误。

Your sequelize config contains:您的续集配置包含:

   host: hostname,
  

So it looks to me as though "hostname" is returning an empty string but is necessary for the connection to proceed.因此,在我看来,“主机名”似乎返回了一个空字符串,但对于继续进行连接是必要的。

Edit to be a little more useful:编辑更有用一点:

The sequelize documentation indicates that it defaults to localhost if not set , but here (I suspect) you are setting host name to an empty string. sequelize 文档表明它默认为 localhost if not set ,但在这里(我怀疑)您将主机名设置为空字符串。 Try setting hostname explicitly to the database host and see if it connects.尝试将主机名显式设置为数据库主机并查看它是否连接。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 sequelize-automate 出现错误“ConnectionError [SequelizeConnectionError]:无法连接到 localhost:1443 - 无法连接(序列)” - Error "ConnectionError [SequelizeConnectionError]: Failed to connect to localhost:1443 - Could not connect (sequence)" using sequelize-automate ConnectionError:无法连接到MyServer:1433 - ConnectionError: Failed to connect to MyServer:1433 ConnectionError:无法连接到{数据库服务器}-无法连接(顺序) - ConnectionError: Failed to connect to {database server} - Could not connect (sequence) ConnectionError [SequelizeConnectionError]:在铁路上连接 ETIMEDOUT 续集部署 - ConnectionError [SequelizeConnectionError]: connect ETIMEDOUT sequelize deploy on railway Node.js MSSQL tedius ConnectionError: Failed to connect to localhost:1433 - connect ECONNREFUSED - Node.js MSSQL tedius ConnectionError: Failed to connect to localhost:1433 - connect ECONNREFUSED 无法连接到 MFQ:1433 nodejs - Failed to connect to MFQ:1433 nodejs 无法连接到本地主机:1433-连接ECONNREFUSED 127.0.0.1:1433 - Failed to connect to localhost:1433 - connect ECONNREFUSED 127.0.0.1:1433 ConnectionError:无法在nodeJS中的mssql中进行连接 - ConnectionError: Failed to connect in mssql in nodeJS ConnectionError:无法连接到 <SQLServerDB> -连接EACCES <SQLServerDB> - ConnectionError: Failed to connect to <SQLServerDB> - connect EACCES <SQLServerDB> [连接错误:15000 毫秒内无法连接到 IP] - [ConnectionError: Failed to connect to IP in 15000ms]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM