ali-sdk/ali-rds

连接sql server 有问题

Closed this issue · 1 comments

  • 代码
    连接信息都是对的
  async sql() {

    const db = rds({
        host: '',
        port:,
        user: '',
        password: '',
        database: ""
      });
      
      let res = await db.query('SELECT * FROM HrmResource from id = 3');

    return res;
  }
  • 错误信息
Handshake inactivity timeout
    at Handshake.<anonymous> (/Users/hilter/work/npm/shellPortal/node_modules/mysql/lib/protocol/Protocol.js:164:17)
    at emitNone (events.js:106:13)
    at Handshake.emit (events.js:208:7)
    at Handshake._onTimeout (/Users/hilter/work/npm/shellPortal/node_modules/mysql/lib/protocol/sequences/Sequence.js:129:8)
    at ontimeout (timers.js:482:11)
    at tryOnTimeout (timers.js:317:5)
    at Timer.listOnTimeout (timers.js:277:5)
    --------------------
    at Protocol._enqueue (/Users/hilter/work/npm/shellPortal/node_modules/mysql/lib/protocol/Protocol.js:145:48)
    at Protocol.handshake (/Users/hilter/work/npm/shellPortal/node_modules/mysql/lib/protocol/Protocol.js:52:23)
    at PoolConnection.connect (/Users/hilter/work/npm/shellPortal/node_modules/mysql/lib/Connection.js:130:18)
    at Pool.getConnection (/Users/hilter/work/npm/shellPortal/node_modules/mysql/lib/Pool.js:48:16)
    at /Users/hilter/work/npm/shellPortal/node_modules/ali-rds/node_modules/pify/index.js:29:7
    at new Promise (<anonymous>)
    at Pool.<anonymous> (/Users/hilter/work/npm/shellPortal/node_modules/ali-rds/node_modules/pify/index.js:12:10)
    at Pool.ret [as getConnection] (/Users/hilter/work/npm/shellPortal/node_modules/ali-rds/node_modules/pify/index.js:56:34)
    at Pool.query (/Users/hilter/work/npm/shellPortal/node_modules/mysql/lib/Pool.js:202:8)
    at /Users/hilter/work/npm/shellPortal/node_modules/ali-rds/node_modules/pify/index.js:29:7
    at new Promise (<anonymous>)
    at Pool.<anonymous> (/Users/hilter/work/npm/shellPortal/node_modules/ali-rds/node_modules/pify/index.js:12:10)
    at Pool.ret [as query] (/Users/hilter/work/npm/shellPortal/node_modules/ali-rds/node_modules/pify/index.js:56:34)
    at RDSClient.proto._query (/Users/hilter/work/npm/shellPortal/node_modules/ali-rds/lib/client.js:34:20)

目前不支持 sql server