Node-mssql: index out of range attempting to connect

Created on 2 May 2016  路  2Comments  路  Source: tediousjs/node-mssql

On attempting to connect to the mysql database, I'm receiving an index of range error.

Running this code.

var mssql = require('mssql');
var options = {
  user:'root',
  password:'password',
  server:'localhost',
  port:3306
  datatase:'test'
};
mssql.connect(options);

Results in this error (I've removed the path before the node_modules).

buffer.js:615
    throw new RangeError('index out of range');
    ^

RangeError: index out of range
    at checkOffset (buffer.js:615:11)
    at Buffer.readUInt8 (buffer.js:653:5)
    at Packet.isLast (/node_modules/tedious/lib/packet.js:112:29)
    at ReadablePacketStream.<anonymous> (/node_modules/tedious/lib/message-io.js:91:18)
    at emitOne (events.js:77:13)
    at ReadablePacketStream.emit (events.js:169:7)
    at readableAddChunk (/node_modules/readable-stream/lib/_stream_readable.js:198:18)
    at ReadablePacketStream.Readable.push (/node_modules/readable-stream/lib/_stream_readable.js:157:10)
    at ReadablePacketStream.Transform.push (/node_modules/readable-stream/lib/_stream_transform.js:123:32)
    at ReadablePacketStream._transform (/node_modules/tedious/lib/message-io.js:57:16)

I know the mysql credentials are correct as I'm using them in another program.

If you need to know any other information let me know.

Most helpful comment

This is a connector for Microsoft SQL Server, not MySQL.

All 2 comments

This is a connector for Microsoft SQL Server, not MySQL.

Haha, god I can be dumb. Thanks man.

I want node-mysql not node-mssql.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aerze picture aerze  路  3Comments

PhantomRay picture PhantomRay  路  4Comments

Halt001 picture Halt001  路  3Comments

jeetendra-choudhary picture jeetendra-choudhary  路  3Comments

andrewmcgivery picture andrewmcgivery  路  5Comments