node-mssql icon indicating copy to clipboard operation
node-mssql copied to clipboard

index out of range attempting to connect

Open rmp135 opened this issue 10 years ago • 2 comments

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.

rmp135 avatar May 02 '16 17:05 rmp135

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

patriksimek avatar May 02 '16 17:05 patriksimek

Haha, god I can be dumb. Thanks man.

I want node-mysql not node-mssql.

rmp135 avatar May 02 '16 17:05 rmp135